public static class ClsUtils
{
public static string GetClientComputerName()
{
return System.Net.Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables("remote_addr")).HostName;
}
}
public class ClsTest
{
public static void Main()
{
Console.WriteLine(ClsUtils.GetClientComputerName());
}
}
Below is VB.NET version converted by Converter, Do changes if you want
Public NotInheritable Class ClsUtils
Private Sub New()
End Sub
Public Shared Function GetClientComputerName() As String
Return System.Net.Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables("remote_addr")).HostName
End Function
End Class
Public Class ClsTest
Public Shared Sub Main()
Console.WriteLine(ClsUtils.GetClientComputerName())
End Function
End Class