主頁 > 知識庫 > XMLHTTP利用POST發(fā)送表單時提交中文的問題

XMLHTTP利用POST發(fā)送表單時提交中文的問題

熱門標簽:vue 地圖標注拖拽 電話機器人銷售公司嗎 鎮(zhèn)江云外呼系統(tǒng)怎么樣 成都銷售外呼系統(tǒng)公司 土地證宗地圖標注符號 客服外呼系統(tǒng)呼叫中心 自動外呼系統(tǒng)怎么防止封卡 保定電銷機器人軟件 電話機器人案例
剛才寫一個小偷程序,突然發(fā)現(xiàn)一旦POST中文時抓取不到內(nèi)容,考慮到中文編碼問題,像javascript中的escape()一樣,在vbscript中也可以使用這個函數(shù),只需要這個發(fā)送就可以正常抓取到內(nèi)容了send("A="escape(A)""escape(B))

完成收工!

附幾個小偷常用的function函數(shù)
Function ByteToStr(vIn)
    Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
    strReturn = "" 
    For i = 1 To LenB(vIn)
        ThisCharCode = AscB(MidB(vIn,i,1))
        If ThisCharCode  H80 Then
            strReturn = strReturn  Chr(ThisCharCode)
        Else
            NextCharCode = AscB(MidB(vIn,i+1,1))
            strReturn = strReturn  Chr(CLng(ThisCharCode) * H100 + CInt(NextCharCode))
            i = i + 1
        End If
    Next
    ByteToStr = strReturn 
End Function

Function GetURL(url,PostStr)
    Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
    With Retrieval
        .Open "POST", url, false ,"" ,""
        .setRequestHeader "Content-Type","application/x-www-form-urlencoded"
        .Send(PostStr)
        GetURL = .ResponseBody
    End With
    Set Retrieval = Nothing
    GetURL=ByteToStr(GetURL)
End Function

Function RegExpText(strng,regStr)
    Dim regEx,Match,Matches,RetStr
    Set regEx = New RegExp
    regEx.Pattern = regStr
    regEx.IgnoreCase = True
    regEx.Global = True
    Set Matches = regEx.Execute(strng)
    For Each Match in Matches
        RetStr = RetStr  Match.Value  "," 
    Next
    RegExpText = RetStr
    set regEx=nothing
End Function


用法:
Dim PostStr,getContent,getArea
PostStr = "action=mobilemobile="MobileNumber
getContent = GetURL("http://www.ip138.com:8080/search.asp",PostStr)
getArea = Replace(Replace(Replace(RegExpText(getContent,"卡號歸屬地/TD>((.|\n)*?)/TD>"),"卡號歸屬地/TD>",""),"TD width=* align=""center"" class=tdc2>",""),"/TD>,","")
Response.Write(getArea)

標簽:內(nèi)江 臺灣 懷化 天津 麗江 成都 重慶 公主嶺

巨人網(wǎng)絡(luò)通訊聲明:本文標題《XMLHTTP利用POST發(fā)送表單時提交中文的問題》,本文關(guān)鍵詞  XMLHTTP,利用,POST,發(fā)送,表單,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《XMLHTTP利用POST發(fā)送表單時提交中文的問題》相關(guān)的同類信息!
  • 本頁收集關(guān)于XMLHTTP利用POST發(fā)送表單時提交中文的問題的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章