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
Different between .net & j2ee ?
What are situations when you register .NET assembly in GAC ?
How to convert a .NET object into COM operabililty?
Differentiate between 'DataSet' and 'SQLDataReader' in ADO.NET?
What is finalize method in .net?
What are the two main parts of the .net framework?
What is difference between static page and dynamic page?
What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?
Explain garbage collection?
What is the use of activex control in .net?
How many namespaces are in .net version 1.1?
What is the new three features of COM+ services, which are not there in COM (MTS)
What is .net and why it is used?
How do you create threading in.net?
How anonymous method is different from a lambda expression?