新手初学VB 大家多多阿里阿多
假设程序 text1.text 获取了信息 然后自动发送到 http://127.0.0.1/post.asp post.asp会request数据 怎么做.我希望能有完整的一个实例.

解决方案 »

  1.   

    post.asp 我会处理接受的数据. vb发送数据我不会.
      

  2.   

    问题已经解决 找了一个下午的代码 baidu真垃圾 还是 google.cn专业哦/Private Sub Command1_Click()
    Dim comfile
    Dim comidstrA = URLEncoding("comfile=xp.dll,中文可以不.&comid=hyxd111")
      Set http = CreateObject("MSXML2.XMLHTTP")
      
      With http
        .Open "POST ", "http://127.0.0.1/post.asp", False
        .setRequestHeader "Content-Type ", "application/x-www-form-urlencoded "
        .setRequestHeader "Content-Length ", Len(strA)
        .send strA
    Text1.Text = bytes2BSTR(.responseBody)
      End With
     
      Label1.Caption = "完成 "
    End Sub
     
      Function URLEncoding(vstrIn)
              strReturn = ""
              For i = 1 To Len(vstrIn)
                      ThisChr = Mid(vstrIn, i, 1)
                      If Abs(Asc(ThisChr)) < &HFF Then
                              strReturn = strReturn & ThisChr
                      Else
                              innerCode = Asc(ThisChr)
                              If innerCode < 0 Then
                                      innerCode = innerCode + &H10000
                              End If
                              Hight8 = (innerCode And &HFF00) \ &HFF
                              Low8 = innerCode And &HFF
                              strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)
                      End If
              Next
              URLEncoding = strReturn
      End Function
        
      Function bytes2BSTR(vIn)
              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
              bytes2BSTR = strReturn
      End Function
      

  3.   

    MSXML2.XMLHTTP 有點像 AJAX 
      

  4.   

    怎样post文件呢?----------------------------------------------------------------------- 
                       人脑潜能开发,潜能开发音乐下载 www.qn21.com