标签:request useragent eth log ipv4 ring context try network
public string UserHostAddress
{
get
{
return HttpContext.Current.Request.UserHostAddress;
}
}
public string IPV4
{
get
{
string result = "0.0.0.0";
IPAddress[] hostAddresses = Dns.GetHostAddresses(Dns.GetHostName());
IPAddress[] array = hostAddresses;
for (int i = 0; i < array.Length; i++)
{
IPAddress iPAddress = array[i];
if (iPAddress.AddressFamily == AddressFamily.InterNetwork)
{
result = iPAddress.ToString();
}
}
return result;
}
}
public string UserHostName
{
get
{
return Dns.GetHostEntry(HttpContext.Current.Request.UserHostAddress).HostName;
}
}
public string UserAgent
{
get
{
return HttpContext.Current.Request.UserAgent;
}
}
public string LogonUser
{
get
{
return HttpContext.Current.Request.ServerVariables["LOGON_USER"].ToString();
}
}
public string ServerName
{
get
{
return HttpContext.Current.Request.ServerVariables["SERVER_NAME"].ToString();
}
}
public string ServerPort
{
get
{
return HttpContext.Current.Request.ServerVariables["SERVER_PORT"].ToString();
}
}
public string FilePath
{
get
{
return HttpContext.Current.Request.FilePath;
}
}
标签:request useragent eth log ipv4 ring context try network
原文地址:https://www.cnblogs.com/wahahaSunnyy/p/10849880.html