我爱Aspx >> C#.Net >> ASP 3.0高级编程(四)& Request.ServerVariables(“PATH_INFO"http://dev.21tx.com/2005/04/27/”")
这将创建一个完整的URL包括端口号(这种情况下,不是标准值80)。例如,结果可能是:
http://194.74.60.254:1768/thispath/thispage.asp
检测浏览器的版本
ServerVariables集合中,另外一个有用的值是用户浏览器的用户代理字符串。在“Detecting the Browser Type"http://dev.21tx.com/2005/04/27/”"页
面(browsertype.asp),使用ServerVariables集合中的“HTTP_USER_AGENT"http://dev.21tx.com/2005/04/27/”"值来获得用户代理字符串,一些脚本用来解析该信息并寻找生产厂家名称和浏览器版本。
<%
strUA = Request.ServerVariables(“HTTP_USER_AGENT"http://dev.21tx.com/2005/04/27/”")
Response.Write “The User Agent string is <B>"http://dev.21tx.com/2005/04/27/”" & strUA & “</B><P>"http://dev.21tx.com/2005/04/27/”"
If InStr(strUA, “MSIE"http://dev.21tx.com/2005/04/27/”") Then
Response.Write “To upgrade your browser go to “_
& “<A HREF="http://dev.21tx.com/2005/04/27/”" & Chr(34) & http://www.microsoft.com/ie/"http://dev.21tx.com/2005/04/27/”"_
& Chr(34) & “>http://www.microsoft.com/ie/<A></P>”
intVersion = Cint(Mid(strUA, InStr(strUA, “MSIE"http://dev.21tx.com/2005/04/27/”") + 5, 1))
If intVersion >=4 Then
Response.Write “You can use Microsoft Dynamic HTML"http://dev.21tx.com/2005/04/27/”"
End If
Else
If InStr(strUA, “Mozilla"http://dev.21tx.com/2005/04/27/”") Then
If InStr(strUA, “compatible;"http://dev.21tx.com/2005/04/27/”") = 0 Then
Response.Write “Your browser is probably Navigator. You can “_
Ҷƪл˵?
ASP实用大全-ASP服务器组件(7)[05-12]
WAP中的ASP技术之一[05-12]
让ASP应用系统成为跨平台的应用系..[05-12]
ASP内置对象 Request对象 详解[05-12]
一些Asp技巧和实用解决方法[05-12]
单机上使用ASP(1)[05-12]
让ASP应用系统成为跨平台的应用系..[05-12]
如何使用ASP记录在线用户的数量[05-12]
一个显示原代码的asp程序[05-12]
使用ASP读出文本文件并显示[05-12]
URL Moniker概述[05-12]
利用ADO进行MSSQL数据库操作[05-12]
JSP由浅入深(2)—— 第一个JSP[05-12]
实例学习PHP之投票程序篇[05-12]
ASP实用大全-ASP服务器组件(7)[05-12]
在Java中应用State设计模式(1)[05-12]
TMarquee 一个字幕控件[05-12]
WAP中的ASP技术之一[05-12]
让ASP应用系统成为跨平台的应用系..[05-12]
几个常用的小函数[05-12]