Get local computer IP address:
Get local computer IP address (C Sharp):
System.Net.dns.GetHostName();
Getting the IP addresses is a little more tricky - as there can be more than one per host name:
System.Net.IPAddress[] a = System.Net.Dns.GetHostAddresses(System.Net.Dns.Get HostName());
for (int i = 0; i < a.Length; i++) { Console.WriteLine(a[i].ToString()); }
Rz Rasel
Amoraboti
If Error – Please Acknowledge Me. (Rz Rasel) Labels: C Sharp |
Post a Comment