Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

how to get Static IP adress in Windows application.

Thanks & Regards

O.Kranthi
Posted

Have a look at this article Finding IP Address Information[^].
 
Share this answer
 
C#
ManagementObjectSearcher searcherNetwork =
       new ManagementObjectSearcher("root\\CIMV2",
       "SELECT * FROM Win32_NetworkAdapterConfiguration");

       foreach (ManagementObject queryObj in searcherNetwork.Get())
       {
           foreach (var prop in queryObj.Properties)
           {
               Console.WriteLine(string.Format("Name: {0} Value: {1}", prop.Name, prop.Value));
           }
       }



or reffer :
http://stackoverflow.com/questions/890449/checking-static-or-dynamic-ip-address-in-c-net[^]
 
Share this answer
 
Comments
kranthi.oru 8-Oct-11 5:31am    
if i copy above lines iam getting error what is name space for ManagementObjectSearcher Please tell me.
 
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