Try to display the IP address, but failed....
-
Hi... using System.Net; In the Main Program, I declared... String strHostName = Dns.GetHostName(); IPAddress[] add1 = Dns.GetHostAddresses(strHostName); // <- set a breakpoint Console.WriteLine("Local Machine: " + add1); In the Locals Dialog box of Visual Studio 2005, I found the value of add1[1] is {15.854.457.47} and type: System.Net.Address. Have any idea to grab this IP Address? Thanks.
-
Hi... using System.Net; In the Main Program, I declared... String strHostName = Dns.GetHostName(); IPAddress[] add1 = Dns.GetHostAddresses(strHostName); // <- set a breakpoint Console.WriteLine("Local Machine: " + add1); In the Locals Dialog box of Visual Studio 2005, I found the value of add1[1] is {15.854.457.47} and type: System.Net.Address. Have any idea to grab this IP Address? Thanks.
-
What do you mean specifically by "grab it"? You have it in a variable, what do you want to do with it?
Experience is the sum of all the mistakes you have done.
-
It looks too obvious, so I don't know if this is what you want: Console.WriteLine("Local Machine: " + add1[1]);
Experience is the sum of all the mistakes you have done.