如何获取客户来访信息,如:您的真实IP 是:222.94.16.11,操作系统:Windows 2000,浏 览 器:Internet Explorer 6.0 最好有源码。问题解决马上结贴.E_mail:[email protected]
解决方案 »
- 一个关于fckeditor的小问题
- asp.net 开发的web部署到03系统的iis后 出现Configuration Error
- 页面状态与事务回滚的问题
- ASP.NET的正则表达式(数据验证)
- 在asp.net.页面中应用iframe的问题 请高手进来帮忙一下!
- Acess删除后为何无刷新;
- 跪求高手,MSDAINITIALIZE
- 怎样处理数据绑定时的异常?
- 书上有句话:一个ASP.NET只能包含一个Form元素,而且必须包含一个Form元素???
- 在DataGrid的編輯模式,在第一個TextBox中輸入料號,從后台數據庫取出名稱放入相鄰的另一個TextBox中﹐應在什么事件中寫代碼,怎樣做?
- window.showModalDialog 弹出的页面 如何点击一个按钮再回到 主页?
- 一个简单,有很郁闷的问题!关于ASP.NET与SQL Server2000的问题
Response.Write("<p>浏览器属性:</p>");
Response.Write("浏览器型号 = " + bc.Type + "<br>");
Response.Write("浏览器名称 = " + bc.Browser + "<br>");
Response.Write("浏览器版本 = " + bc.Version + "<br>");
Response.Write("主版本号 = " + bc.MajorVersion + "<br>");
Response.Write("从版本号 = " + bc.MinorVersion + "<br>");
Response.Write("操作系统 = " + bc.Platform + "<br>");
Response.Write("是否试用版 = " + bc.Beta + "<br>");
Response.Write("Is Crawler = " + bc.Crawler + "<br>");
Response.Write("Is AOL = " + bc.AOL + "<br>");
Response.Write("16位机 = " + bc.Win16 + "<br>");
Response.Write("32位机 = " + bc.Win32 + "<br>");
Response.Write("支持Frame = " + bc.Frames + "<br>");
Response.Write("支持Table = " + bc.Tables + "<br>");
Response.Write("支持Cookies = " + bc.Cookies + "<br>");
Response.Write("支持VB Script = " + bc.VBScript + "<br>");
Response.Write("支持 JavaScript = " + bc.JavaScript + "<br>");
Response.Write("支持 Java Applets = " + bc.JavaApplets + "<br>");
Response.Write("支持 ActiveX Controls = " + bc.ActiveXControls + "<br>");
Response.Write("电台CDF = " + bc.CDF + "<br>");
Response.Write(Request.UserAgent);
Response.Write ("<script language='javascript'>//读屏幕的大小screenWidth=screen.width;screenHeight=screen.height;</script>");
//屏幕分辨率的高:Response.Write (window.screen.height);
//屏幕分辨率的宽:"+ window.screen.width;
//屏幕可用工作区高度:"+ window.screen.availHeight;
//屏幕可用工作区宽度:"+ window.screen.availWidth
// IP addressess and related information.using System;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;namespace Mssc.Services.ConnectionManagement
{ class TestIPAddress
{ /**
* The IPAddresses method obtains the selected server IP address information.
* It then displays the type of address family supported by the server and its
* IP address in standard and byte format.
**/
private static void IPAddresses(string server)
{
try
{
System.Text.ASCIIEncoding ASCII = new System.Text.ASCIIEncoding();
// Get server related information.
IPHostEntry heserver = Dns.Resolve(server); // Loop on the AddressList
foreach (IPAddress curAdd in heserver.AddressList)
{
// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InternNetworkV6. If the server
// is also IPv4-enabled there will be an additional value of InterNetwork.
Console.WriteLine("AddressFamily: " + curAdd.AddressFamily.ToString());
// Display the ScopeId property in case of IPV6 addresses.
if(curAdd.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString())
Console.WriteLine("Scope Id: " + curAdd.ScopeId.ToString());
// Display the server IP address in the standard format. In
// IPv4 the format will be dotted-quad notation, in IPv6 it will be
// in in colon-hexadecimal notation.
Console.WriteLine("Address: " + curAdd.ToString());
// Display the server IP address in byte format.
Console.Write("AddressBytes: "); Byte[] bytes = curAdd.GetAddressBytes();
for (int i = 0; i < bytes.Length; i++)
{
Console.Write(bytes[i]);
} Console.WriteLine("\r\n"); } }
catch (Exception e)
{
Console.WriteLine("[DoResolve] Exception: " + e.ToString());
}
}
private static void IPAddressAdditionalInfo()
{
try
{
// Display the flags that show if the server supports IPv4 or IPv6
// address schemas.
Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4);
Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6)
{
// Display the server Any address. This IP address indicates that the server
// should listen for client activity on all network interfaces.
Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address.
Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString());
// Used during autoconfiguration first phase.
Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString());
Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback));
}
Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback));
}
catch (Exception e)
{
Console.WriteLine("[IPAddresses] Exception: " + e.ToString());
}
}
)的信息吗?????????
string ac="您的真实IP 是:"+Request.ServerVariables["REMOTE_HOST"].ToString()+",操作系统:"+bc.Platform +",浏 览 器:"+
bc.Version +bc.MajorVersion +bc.MinorVersion ;
Response.Write(ac);
Response.Write("<p>Browser Capabilities:</p>");
Response.Write("Type = " + bc.Type + "<br>");
Response.Write("Name = " + bc.Browser + "<br>");
Response.Write("Version = " + bc.Version + "<br>");
Response.Write("Major Version = " + bc.MajorVersion + "<br>");
Response.Write("Minor Version = " + bc.MinorVersion + "<br>");
Response.Write("Platform = " + bc.Platform + "<br>");
Response.Write("Is Beta = " + bc.Beta + "<br>");
Response.Write("Is Crawler = " + bc.Crawler + "<br>");
Response.Write("Is AOL = " + bc.AOL + "<br>");
Response.Write("Is Win16 = " + bc.Win16 + "<br>");
Response.Write("Is Win32 = " + bc.Win32 + "<br>");
Response.Write("Supports Frames = " + bc.Frames + "<br>");
Response.Write("Supports Tables = " + bc.Tables + "<br>");
Response.Write("Supports Cookies = " + bc.Cookies + "<br>");
Response.Write("Supports VB Script = " + bc.VBScript + "<br>");
Response.Write("Supports JavaScript = " + bc.JavaScript + "<br>");
Response.Write("Supports Java Applets = " + bc.JavaApplets + "<br>");
Response.Write("Supports ActiveX Controls = " + bc.ActiveXControls + "<br>");
Response.Write("CDF = " + bc.CDF + "<br>");
private static void IPAddressAdditionalInfo()
{
try
{
// Display the flags that show if the server supports IPv4 or IPv6
// address schemas.
Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4);
Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6)
{
// Display the server Any address. This IP address indicates that the server
// should listen for client activity on all network interfaces.
Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address.
Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString());
// Used during autoconfiguration first phase.
Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString());
Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback));
}
Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback));
}
catch (Exception e)
{
Console.WriteLine("[IPAddresses] Exception: " + e.ToString());
}
}
// This IPAddressAdditionalInfo displays additional server address information.
private static void IPAddressAdditionalInfo()
{
try
{
// Display the flags that show if the server supports IPv4 or IPv6
// address schemas.
Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4);
Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6)
{
// Display the server Any address. This IP address indicates that the server
// should listen for client activity on all network interfaces.
Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address.
Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString());
// Used during autoconfiguration first phase.
Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString());
Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback));
}
Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback));
}
catch (Exception e)
{
Console.WriteLine("[IPAddresses] Exception: " + e.ToString());
}
}
// This IPAddressAdditionalInfo displays additional server address information.
private static void IPAddressAdditionalInfo()
{
try
{
// Display the flags that show if the server supports IPv4 or IPv6
// address schemas.
Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4);
Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6)
{
// Display the server Any address. This IP address indicates that the server
// should listen for client activity on all network interfaces.
Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address.
Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString());
// Used during autoconfiguration first phase.
Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString());
Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback));
}
Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback));
}
catch (Exception e)
{
Console.WriteLine("[IPAddresses] Exception: " + e.ToString());
}
}
// This IPAddressAdditionalInfo displays additional server address information.
private static void IPAddressAdditionalInfo()
{
try
{
// Display the flags that show if the server supports IPv4 or IPv6
// address schemas.
Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4);
Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6)
{
// Display the server Any address. This IP address indicates that the server
// should listen for client activity on all network interfaces.
Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address.
Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString());
// Used during autoconfiguration first phase.
Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString());
Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback));
}
Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback));
}
catch (Exception e)
{
Console.WriteLine("[IPAddresses] Exception: " + e.ToString());
}
}
String ClientIP;
ClientIP = Request.UserHostAddress;获得浏览器相关信息:
HttpBrowserCapabilities bc = Request.Browser;
Response.Write("<p>Browser Capabilities:</p>");
Response.Write("Type = " + bc.Type + "<br>");
Response.Write("Name = " + bc.Browser + "<br>");
Response.Write("Version = " + bc.Version + "<br>");
Response.Write("Major Version = " + bc.MajorVersion + "<br>");
Response.Write("Minor Version = " + bc.MinorVersion + "<br>");
Response.Write("Platform = " + bc.Platform + "<br>");
Response.Write("Is Beta = " + bc.Beta + "<br>");
Response.Write("Is Crawler = " + bc.Crawler + "<br>");
Response.Write("Is AOL = " + bc.AOL + "<br>");
Response.Write("Is Win16 = " + bc.Win16 + "<br>");
Response.Write("Is Win32 = " + bc.Win32 + "<br>");
Response.Write("Supports Frames = " + bc.Frames + "<br>");
Response.Write("Supports Tables = " + bc.Tables + "<br>");
Response.Write("Supports Cookies = " + bc.Cookies + "<br>");
Response.Write("Supports VB Script = " + bc.VBScript + "<br>");
Response.Write("Supports JavaScript = " + bc.JavaScript + "<br>");
Response.Write("Supports Java Applets = " + bc.JavaApplets + "<br>");
Response.Write("Supports ActiveX Controls = " + bc.ActiveXControls + "<br>");
Response.Write("CDF = " + bc.CDF + "<br>");详细请参见
ms-help://MS.NETFrameworkSDKv1.1.CHS/cpref/html/frlrfsystemwebhttprequestmemberstopic.htm
如果操作系统是windows2000就返回:windwos2000,如果是windows2003就返回windows2003.
如果操作系统是windows2000就返回:windwos2000,如果是windows2003就返回windows2003.
如果操作系统是windows2000就返回:windwos2000,如果是windows2003就返回windows2003.
仅仅根据 Request.Browser.Platform 可能还不足于确定 OS 的实际版本Request.Browser.Platform 返回值:
Win2000 => Win 2K
WinNT => Win NT / Win 2K / Win XP
Win98 => Win 98
Win95 => Win 95Request.Browser.Version 返回值:
IE 5.0 => Internet Explorer 5.0
IE 6.0 => Internet Explorer 6.0
browser=GetBrowser(Request.UserAgent);
ip=这个就不用写了吧!;)public static string GetOs(string useragent)
{
if(useragent.IndexOf("Windows 2003")>-1 || useragent.IndexOf("NT 5.2")>-1)
return "Windows 2003";
else if(useragent.IndexOf("Windows XP")>-1 || useragent.IndexOf("NT 5.1")>-1)
return "Windows XP";
else if(useragent.IndexOf("Windows 2000")>-1 || useragent.IndexOf("NT 5")>-1)
return "Windows 2000";
else if(useragent.IndexOf("Windows NT")>-1 || useragent.IndexOf("WinNT")>-1)
return "Windows NT 4";
else if(useragent.IndexOf("Windows 95")>-1 || useragent.IndexOf("Win95")>-1)
return "Windows 95";
else if(useragent.IndexOf("Windows ME")>-1 || useragent.IndexOf("Win 9x 4.90")>-1)
return "Windows ME";
else if(useragent.IndexOf("Windows 98")>-1 || useragent.IndexOf("Win98")>-1)
return "Windows 98";
else if(useragent.IndexOf("Windows CE")>-1)
return "Windows CE"; else if(useragent.IndexOf("PalmOS")>-1)
return "PalmOS";
else if(useragent.IndexOf("Linux")>-1)
return "Linux";
else if(useragent.IndexOf("Solaris")>-1)
return "Solaris";
else if(useragent.IndexOf("SunOS")>-1)
return "SunOS";
else if(useragent.IndexOf("BSD")>-1)
return "Free BSD";
else if(useragent.IndexOf("Unix")>-1)
return "Unix";
else if(useragent.IndexOf("Mac OS X")>-1)
return "Mac OS X";
else if(useragent.IndexOf("Mac_PowerPC")>-1)
return "Mac_PowerPC";
else if(useragent.IndexOf("6800")>-1)
return "Mac 68k";
else if(useragent.IndexOf("Mac")>-1)
return "Macintosh";
else if(useragent.IndexOf("OS/2")>-1)
return "OS/2";
else
return "Unknown"; }
public static string GetBrowser(string useragent)
{
if(useragent.IndexOf("MyIE2")>-1)
return "MyIE2";
else if(useragent.IndexOf("NetCaptor")>-1)
return "NetCaptor";
else if(useragent.IndexOf("MSIE 7")>-1)
return "Microsoft IE 7";
else if(useragent.IndexOf("MSIE 6")>-1)
return "Microsoft IE 6";
else if(useragent.IndexOf("MSIE 5")>-1)
return "Microsoft IE 5";
else if(useragent.IndexOf("Opera")>-1)
return "Opera";
else if(useragent.IndexOf("MSIE 4")>-1)
return "Microsoft IE 4";
else if(useragent.IndexOf("MSIE")>-1)
return "Microsoft IE";
else if(useragent.IndexOf("Netscape/8")>-1)
return "Netscape8";
else if(useragent.IndexOf("Netscape/7")>-1)
return "Netscape7";
else if(useragent.IndexOf("Netscape6")>-1)
return "Netscape6";
else if(useragent.IndexOf("Mozilla/4")>-1)
return "Netscape4";
else if(useragent.IndexOf("Mozilla/3")>-1)
return "Netscape3";
else if(useragent.IndexOf("Mozilla/2")>-1)
return "Netscape2";
else if(useragent.IndexOf("Mozilla/1")>-1)
return "Netscape1";
else if(useragent.IndexOf("AOL")>-1)
return "AOL";
else if(useragent.IndexOf("Sun")>-1)
return "HotJava";
else
return "Unknown"; }
useragent指什么?
bc.Version +bc.MajorVersion +bc.MinorVersion ;
Response.Write(ac);
你有没有发个例子给
[email protected]