/####################################### #####
Copyright:
The content of this article is edited on this site. You can reprint, publish, and use it at will, but please note the original source of the article and this statement in plain text.
Http://www.opent.cnAuthor: langtaosha
######################################## ####/
# Region obtain the remote IP address and browser type
/// <Summary>
/// Obtain the remote IP address and browser type
/// </Summary>
/// <Returns> </returns>
Public static string getip ()
{
String STR = "";
// Obtain the real IP address of the remote user through the proxy server:
If (system. Web. httpcontext. Current. Request. servervariables ["http_via"]! = NULL)
STR = system. Web. httpcontext. Current. Request. servervariables ["http_x_forwarded_for"]. tostring ();
Else
STR = system. Web. httpcontext. Current. Request. servervariables ["remote_addr"]. tostring ();
Httpbrowsercapabilities BC = new httpbrowsercapabilities ();
BC = system. Web. httpcontext. Current. Request. browser;
STR + = "& nbsp; your operating system:" + bc. Platform + "browser:" + bc. type;
Return STR;
}
# Endregion