D Dexlex Feb 13, 2007 #2 using System.Net; .... string hostName = Dns.GetHostName(); IPHostEntry thisHost = Dns.GetHostEntry(hostName); string thisIpAddr = thisHost.AddressList[0].ToString(); Dex
using System.Net; .... string hostName = Dns.GetHostName(); IPHostEntry thisHost = Dns.GetHostEntry(hostName); string thisIpAddr = thisHost.AddressList[0].ToString(); Dex
G Guest Feb 13, 2007 #3 Thanks, it works but I have a strange situation: When I run this code in a new windows form application it work fine. When I run this code in my application I get a message from VS2005: "The connection with the device lost" any idea? Dexlex said: using System.Net; .... string hostName = Dns.GetHostName(); IPHostEntry thisHost = Dns.GetHostEntry(hostName); string thisIpAddr = thisHost.AddressList[0].ToString(); Dex Ofer B. said: Hello, How can I get the device IP using C#? Thanks Click to expand... Click to expand...
Thanks, it works but I have a strange situation: When I run this code in a new windows form application it work fine. When I run this code in my application I get a message from VS2005: "The connection with the device lost" any idea? Dexlex said: using System.Net; .... string hostName = Dns.GetHostName(); IPHostEntry thisHost = Dns.GetHostEntry(hostName); string thisIpAddr = thisHost.AddressList[0].ToString(); Dex Ofer B. said: Hello, How can I get the device IP using C#? Thanks Click to expand... Click to expand...