remoteCode.asp
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 1k
Development Platform:

VBScript

  1. <%
  2. 'On Error Resume Next
  3. 'Server.ScriptTimeOut=9999999
  4. Function getHTTPPage(Path)
  5.         t = GetBody(Path)
  6.         getHTTPPage=BytesToBstr(t,"GB2312")
  7. End function
  8. Function GetBody(url) 
  9.         on error resume next
  10.         Set Retrieval = CreateObject("Microsoft.XMLHTTP") 
  11.         With Retrieval 
  12.         .Open "Get", url, False, "", "" 
  13.         .Send 
  14.         GetBody = .ResponseBody
  15.         End With 
  16.         Set Retrieval = Nothing 
  17. End Function
  18. Function BytesToBstr(body,Cset)
  19.         dim objstream
  20.         set objstream = Server.CreateObject("adodb.stream")
  21.         objstream.Type = 1
  22.         objstream.Mode =3
  23.         objstream.Open
  24.         objstream.Write body
  25.         objstream.Position = 0
  26.         objstream.Type = 2
  27.         objstream.Charset = Cset
  28.         BytesToBstr = objstream.ReadText 
  29.         objstream.Close
  30.         set objstream = nothing
  31. End Function
  32. Function Newstring(wstr,strng)
  33.         Newstring=Instr(lcase(wstr),lcase(strng))
  34.         if Newstring<=0 then Newstring=Len(wstr)
  35. End Function
  36. %>
  37. <%
  38. Function GetCode(user,password,codeNumber)
  39. dim url
  40. url="http://localhost/test/index.asp?user="&user&"&pass="&password&"&codenumber="&codeNumber
  41. GetCode=getHTTPPage(url)
  42. end Function
  43. %>