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 |
How do we access crystal reports in .net?
What is lazy initialization?
What are the collections you've used?
Can a dll be changed to an exe?
What is a system lock?
What is data type and how many types of data types are in .NET ?
Explain the difference between constants and read-only variables?
If I am writing in a language like vb or c++, what are the procedures to be followed to support .net?
What is meant fulltrust?
Elements of CAS
What is misl?
what is use of learning .net? does we get good jobs based on .net?