How to get the hostname or IP address of the server?
Answers were Sorted based on User's Feedback
Answer / praveen
string IpAddress=HttpContext.Current.Request.UserHostName;
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Difference between user groups and code groups
What are data types in .NET?
Where does the dispose method lie and how can it be used to clean up resources?
What's the problem with .net generics?
What property do you have to set to tell the grid which page to go to when using the Pager object?
What is SOAP? How you will do windows and forms authentication?
What is Entity Relationship Model in .NET?
what is object lock?
What are multicast delegates?
Explain assemblies in .net?
What is the difference between an abstract class and an interface?
What is namespace in .net?