Click here to Skip to main content
15,921,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me to do this. I am a beginner in c# coding
Posted

1 solution

Hope this would work,
C#
foreach (NetworkInterface netif in NetworkInterface.GetAllNetworkInterfaces())
{
    IPInterfaceProperties properties = netif.GetIPProperties();
    foreach (IPAddressInformation unicast in properties.UnicastAddresses)
    {
           Console.Writeline(unicast.Address);
    }
}


or look at here,
How To Get IP Address Of A Machine[^]

-KR
 
Share this answer
 
Comments
VadhulGanesh 25-Mar-14 0:24am    
thank you Rohit. Will try it out and send you the ststus
VadhulGanesh 25-Mar-14 0:25am    
actually can you please help me with c# code.
Krunal Rohit 25-Mar-14 0:28am    
This is a C# code.

-KR
VadhulGanesh 25-Mar-14 0:32am    
oh thank you.
Krunal Rohit 25-Mar-14 0:36am    
Glad I could help :)

-KR

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