浏览器识别-ASP 的 MSWC.BrowserType

作者:vkvi 来源:千一网络(原创) 日期:2010-8-17

用 User Agent 可以识别浏览器,但 ASP 中用 MSWC.BrowserType 将更方便,因为它相当于把 User Agent 拆解开了,并且它还能检测更多。

dim bc
set bc = Server.CreateObject("MSWC.BrowserType")
Response.Write("<p>Platform: " + bc.Platform + "</p>")
Response.Write("<p>Browser: " + bc.Browser + "</p>")
Response.Write("<p>Version: " + bc.Version + "</p>")
Response.Write("<p>Beta: " + CStr(bc.Beta) + "</p>")
Response.Write("<p>Frames: " + CStr(bc.Frames) + "</p>")
Response.Write("<p>Tables: " + CStr(bc.Tables) + "</p>")
Response.Write("<p>Backgroundsounds: " + CStr(bc.Backgroundsounds) + "</p>")
Response.Write("<p>Cookies: " + CStr(bc.Cookies) + "</p>")
Response.Write("<p>VBScript: " + CStr(bc.VBScript) + "</p>")
Response.Write("<p>JavaScript: " + CStr(bc.JavaScript) + "</p>")
Response.Write("<p>ActiveXControls: " + CStr(bc.ActiveXControls) + "</p>")
Response.Write("<p>Cdf: " + CStr(bc.Cdf) + "</p>")
Response.Write("<p>Javaapplets: " + CStr(bc.Javaapplets) + "</p>")
set bc = nothing

 

你前面那位网友看了:现在手机短信就两个作用

▲▲▲嘿,欢迎转载传播本站原创文章,尽量保留来源噢。▲▲▲

文章评论
赞助商们