Click here to Skip to main content
15,920,053 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
I try to get the ip of the local computer in WPF but it fail...
I allready done that in WinForm but in WPF it does not work.
can someone give me a little code that works?
Thank you all.
Posted
Comments
#realJSOP 28-Aug-10 15:23pm    
You're going to have to show us how you're doing it...
Sandeep Mewara 28-Aug-10 15:33pm    
'fail' as in?

You need to post your code. WPF has NOTHING to do with IP addresses, therefore your code will work fine, so long as you import the dlls that provide the methods you call.
 
Share this answer
 
MIDL
IPAddress[] a = Dns.GetHostByName(Dns.GetHostName()).AddressList;
 string ip = a[0].ToString();
        txtIp.Text = ip;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900