Hai friends… Could anyone help me to find the IP address oft the system through the coding…
It depends on which IP address do you need. Anyway, try this:
System.String hostName = System.Net.Dns::GetHostName();
System.Net.IPHostEntry hostEntry = System.Net.Dns::GetHostEntry(hostName);
System.Net.IPAddress[] addresses = hostEntry.get_AddressList();
System.Net.IPAddress address;
System.Net.Sockets.AddressFamily addressFamily;
System.Collections.IEnumerator enumerator = addresses.GetEnumerator();
while (enumerator.MoveNext())
{
address = enumerator.get_Current();
addressFamily = address.get_AddressFamily();
if (addressFamily == System.Net.Sockets.AddressFamily::InterNetwork)
{
info(address.ToString());
}
}
Thanks martin Really its usefull for me…
once again thanks for ur reply…Ur great Boss
Martin,
This is very helpful for report printing purposes.
Thanks,
G.Rajkumar