VB 使用 WebBrowser 控件 POST 数据,VB WebBrowser 控件 POST 数据,VB WebBrowser 控件 POST,VB WebBrowser POST 数据,VB WebBrowser POST,WebBrowser Post 数据,WebBrowser Post,VB WebBrowser,WebBrowser。

VB使用WebBrowser控件POST数据:

Private Sub Form_Load()
    ReDim aByte(0) As Byte
    PackBytes aByte(), "id=111&ps=222"
    WebBrowser1.Navigate "http://127.0.0.1:90/test.cgi", , , aByte, "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)
End Sub

Private Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)
    ReDim ByteArray(iNewBytes)
    For i = 0 To iNewBytes
        ch = Mid(PostData, i + 1, 1)
        If ch = Space(1) Then
            ch = "+"
        End If
        Debug.Print ch, Asc(ch)
        ByteArray(i) = Asc(ch)
    Next
End Sub