Get IP Address Of A System using c# :
The following just two line code to useful for Get IP Address Of A Machine using C#.
Code:
The following just two line code to useful for Get IP Address Of A Machine using C#.
Code:
// Get the hostname
string yourHost = System.Net.Dns.GetHostName();
// Show the hostname
lblMyhost.Text = yourHost;
// Get the IP from the host name
string yourIP = System.Net.Dns.GetHostEntry(yourHost).AddressList[0].ToString();
// Show the IP
lblIPAddress.Text = yourIP;
string yourHost = System.Net.Dns.GetHostName();
// Show the hostname
lblMyhost.Text = yourHost;
// Get the IP from the host name
string yourIP = System.Net.Dns.GetHostEntry(yourHost).AddressList[0].ToString();
// Show the IP
lblIPAddress.Text = yourIP;
0 comments:
Post a Comment
Share your thoughts here...