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 |
What is value type and refernce type in .net?
Explain the different types of proxy patterns?
Explain how com+ related to the dna architecture?
What is the difference between reference type and value type?
What is use of ContextUtil class?
Which Namespace is used to to achieve MultiThreading in .NET?
Is there a way to suppress the finalize process inside the garbage collector forcibly in .net?
What is prerender event of a page?
What are the different types of assemblies?
Can you write a class without specifying namespace?
Which method do you use to redirect the user to another page without performing a round trip to the client?
What is portable executable (PE)?