測試文字功能,小工具,標題

記錄很重要,不然會浪費很多時間在找以前的記憶

一個人的氣度,決定他未來的高度。

2014年4月17日 星期四

ASP.NET 取得 瀏覽器 Browser 的一些相關訊息

取得 瀏覽器 的一些訊息

參考msdn網址
http://msdn.microsoft.com/zh-tw/library/system.web.httprequest.browser.aspx

=============C# CODE====================================
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("SupportsActiveXControls = "+bc.ActiveXControls+"<br>");
Response.Write("CDF = " + bc.CDF + "<br>");


IE秀出來的東西

有空再試一下這個,配合陣列去查 
http://msdn.microsoft.com/zh-tw/library/7cct0x33.aspx

string ba = Request.UserAgent;
 Response.Write("UserAgent = " + ba + "<br>");

沒有留言:

張貼留言