ArticleDirectory
Demo:
< % Dim Apisiteapisite = " Http: // 127.0.0.1/XXXXX/ " Dim Freehost_t1 Dim Freehost_t2 Dim Freehost_t3 Dim Freehost_t4freehost_t1 = 20000 Freehost_t2 = 20000 Freehost_t3 = 30000 Freehost_t4 = 240000 Function Getop (TAR, req) Dim Objxmlhttp Set Objxmlhttp = server. Createobject ( " WinHTTP. winhttprequest.5.1 " ) Objxmlhttp. Option ( 6 ) = 0 Objxmlhttp. settimeouts freehost_t1, freehost_t2, freehost_t3, freehost_t4 objxmlhttp. Open " Get " , Apisite & tar & " ? " & Req, False Objxmlhttp. Send If Objxmlhttp. Status = 200 Then Getop = Bytes2bstr (objxmlhttp. responsebody) Else Getop = " HTTP status: " & Objxmlhttp. Status & " Information: " & Bytes2bstr (objxmlhttp. responsebody) End If Set Objxmlhttp = Nothing End Function Function Getopbyte (TAR, req) Dim Objxmlhttp Set Objxmlhttp = server. Createobject ( " WinHTTP. winhttprequest.5.1 " ) Objxmlhttp. Option ( 6 ) =0 Objxmlhttp. settimeouts freehost_t1, freehost_t2, freehost_t3, freehost_t4 objxmlhttp. Open " Get " , Apisite & tar & " ? " & Req, False Objxmlhttp. Send If Objxmlhttp. Status = 200 Then Getopbyte =Objxmlhttp. responsebody Else Getop = " HTTP status: " & Objxmlhttp. Status & " Information: " & Bytes2bstr (objxmlhttp. responsebody) End If Set Objxmlhttp = Nothing End Function Function Postop (TAR, postbody) Dim Objxmlhttp Set Objxmlhttp = server. Createobject ( " WinHTTP. winhttprequest.5.1 " ) Objxmlhttp. Option ( 6 ) = 0 Objxmlhttp. settimeouts freehost_t1, freehost_t2, freehost_t3, freehost_t4 objxmlhttp. Open " Post " , Apisite & tar, False Objxmlhttp. setRequestHeader " Content-Type " , " Application/X-WWW-form-urlencoded " Objxmlhttp. setRequestHeader " Content-Length " , Len (Postbody) objxmlhttp. Send postbody If Objxmlhttp. Status = 200 Then Postop = Bytes2bstr (objxmlhttp. responsebody) Else Postop = " HTTP status: " & Objxmlhttp. Status & " Information: " &Bytes2bstr (objxmlhttp. responsebody) End If Set Objxmlhttp = Nothing End Function Function Bytes2bstr (VIN) Dim Bytesstream, stringreturn Set Bytesstream = server. Createobject ( " ADODB. Stream " ) Bytesstream. Type = 2 Bytesstream. Open bytesstream. writetext Vin bytesstream. Position = 0 Bytesstream. charset = " Big5 " Bytesstream. Position = 2 Stringreturn = Bytesstream. readtext bytesstream. Close Set Bytesstream =Nothing Bytes2bstr = Stringreturn End Function % >
''Apiret = getop ("index. ASP "," Act = stockmoveresetpdf & Mid = "& mid _ &" & state1 = "& state1 &" & state2 = "& state2 &" & state3 = "& state3)
''Apiret = postop ("index. asp", request. Form)
References:
Http://www.docin.com/p-387428585.html