取得完整路径和文件名,如http://stuit.cn/It/Default.asp
<% Function GetUrl() On Error Resume Next Dim strTemp If LCase(Request.ServerVariables("HTTPS")) = "off" Then strTemp = "http://" Else strTemp = "https://" End If strTemp = strTemp & Request.ServerVariables("SERVER_NAME") If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT") strTemp = strTemp & Request.ServerVariables("URL") If Trim(Request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString) GetUrl = strTemp End Function ’Response.write GetUrl() url1=GetUrl() url1=Server.URLEncode(url1) %> <%=geturl()%>
取得单纯文件名,如Default.asp
<%=Request.ServerVariables("url")%> |
|
|