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
What is typical about a windows process in regards to memory allocation in .net?
Explain the use of activex control in .net?
What is the difference between response.redirect & server.transfer?
what is machine key error in .NET how can we solve it?
Different between .net & j2ee ?
Explain what is immutability, what is it for and how is it codified?
What is static constructor, when it will be fired?
What are Satellite Assemblies? How you will create this? How will you get the different language strings?
What are the challenging issues you have faced in implementation project/Maintainance project in .net Functionality? How you have overcome that issue?
Does .net supports destructors concept?
Explain why do we use the “using” statement?
What do you mean by Code Access Security in .NET?
What is Event Bubbling in .NET?
How will you make .NET programs work in Linux ?
What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?