asp 에서 xml http 구성 요소 패키지

asp 에서 xmlhttp 구성 요소 패키지 에 적 힌 도둑 함수 입 니 다.빨간색 코드 부분 에 주의 하 세 요.다른 것 은 스스로 추가 하 세 요!Function PostHttpPageFrom(HttpUrl,stra,FromUrl)    Dim Http Set Http=server.createobject("MSXML2.XMLHTTP")    Http.open "POST",HttpUrl,False    Http.setrequestheader "content-length",len(stra)   Http.setrequestheader "content- type","application/x-www-form-urlencoded"    Http.setrequestheader "Referer",FromUrl    Http.send stra  If Http.Readystate<>4 then       Set Http=Nothing  GetHttpPage="$False$" Exit function End if PostHttpPageFrom=bytesToBSTR(Http.responseBody,"gb2312")   Set Http=Nothing If Err.number<>0 then       Err.Clear End If End Function Function BytesToBstr(Body,Cset)    Dim Objstream Set Objstream = Server.CreateObject("adodb.stream")    objstream.Type = 1 objstream.Mode =3 objstream.Open1 d) objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset    BytesToBstr = objstream.ReadText    objstream.Close    set objstream = nothing End Function

좋은 웹페이지 즐겨찾기