How to get the hostname or IP address of the server?
Answer Posted / soumya
Dim myHost As String = System.Net.Dns.GetHostName
Dim myIPs As System.Net.IPHostEntry =
System.Net.Dns.GetHostByName(myHost)
MessageBox.Show("The name of the host is = " &
myIPs.HostName, "Host Name", MessageBoxButtons.OK,
MessageBoxIcon.Information)
For Each myIP As System.Net.IPAddress In myIPs.AddressList
MessageBox.Show("The IP address of host is = " &
myIP.ToString, "Host IP Address", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Next
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain me what is the .net framework and how does it work?
What is web.config in .net?
Tell us what do the following acronyms in .net stand for: il, cil, msil, cli and jit?
What are the differences between user control and server control?
Explain what is the difference between a class and an object?
Is .net a programming language?
What is the root class in .net?
What is RPC? What is the use of it?
Is there any inbuilt tool or command provided by .NET to view the code inside the assembly?
Explain about managed heap?
Explain how do assemblies find each other?
Explain what is the difference between a class and an object, and how do these terms relate to each other?
What are situations when you register .NET assembly in GAC ?
What are the similarities and difference between class and structure in .net?
Explain how com+ related to the dna architecture?