'获取当前Url参数的函数 Function GetUrl() Dim ScriptAddress,Servername,qs ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) Servername = CStr(Request.ServerVariables("Server_Name")) qs=Request.QueryString if qs<>"" the
在拼接绝对路径的网址时,经常需要从Request.Url中获取根网址(比如http://www.cnblogs.com),然后与相对路径一起拼接为绝对路径. 以前的做法如下: var uri = Request.Url.Scheme + "://" + Request.Url.Host + "/aggsite/topviews"; 今天发现了更简单的方法: var uri = Request.Url.GetLeftPart(UriPartial.Authority)
ASP代码(ASP获取页面源码方法,有编码.超时时间参数,处理了乱码.超时的问题): Function GetHttpPage(HttpUrl) Then GetHttpPage="$False$" Exit Function End If Dim Http 'Set Http=server.createobject("MSXML2.XMLHTTP") Set Http=server.createobject("MSxml2.ServerxmlHTTP&q
Function GetHttpPage(HttpUrl,endoce) If endoce = "" Then endoce = "GB2312" If IsNull(HttpUrl)=True Or Len(HttpUrl)<18 Or HttpUrl="$False$" Then GetHttpPage="$False$" Exit Function End If Dim Http Set Http=server.
<% '获取文件名(不含扩展名) Function getFilename(text)text = Left(text,inStrRev(text,".")-1)getFilename = text End Function '获取扩展名 Function getExtn(text)text = Left(text,inStr(text,".")-1)getExtn = textEnd Function%>