优化 ASP 应用程序和 VBScript 的技巧。
<% function GetSourceInfo(byval url) dim xmlhttp,xmlget,bgpos,endpos Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP") strA=server.urlencode("abc") With xmlhttp .Open "POST", url, False .setRequestHeader "Content-Length",len(strA) .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded" .Send strA if .status<>200 then xmlget="error" else xmlget = bin2str(.responseBody) end if End With set xmlhttp = nothing GetSourceInfo=xmlget end function Function bin2str(binstr) Const adTypeBinary = 1 Const adTypeText = 2 Dim BytesStream,StringReturn Set BytesStream = Server.CreateObject("ADODB.Stream") %>