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 clr in .net?
Explain attributes in dot net?
What is Event - Delegate? clear syntax for writing a event delegate
How you apply a theme in whole application in .Net?
What is il and c#?
What is .net assembly?
Tell us what is json data, and what is one way that .net developers can work with json?
How boxing and unboxing occures in memory?
What is the need of OLE-automation?
Explain can the validation be done in the server side? Or this can be done only in the client side?
What is .net standard?
What is CCW (COM Callable Wrapper)