Private Sub Command1_Click()
    strA = "address=中国浙江"
    Set http = CreateObject("MSXML2.XMLHTTP")
    With http
    .open "POST", "http://127.0.0.1/a.asp", False
    .send strA
    End With
    Label1.Caption = "完成"
End Sub我写了个测试的asp文件:
<%
if request.form("address")<>"" then application("a")=request.form("address")
response.write application("a")
%>但是还是接到不到数据啊?什么原因,状态也完成了

解决方案 »

  1.   

    Private   Sub   Command1_Click() 
            strA   =   "address=中国浙江 " 
            Set   http   =   CreateObject( "MSXML2.XMLHTTP ") 
            With   http 
            .open   "POST ",   "http://127.0.0.1/a.asp ",   False 
            .setRequestHeader("Content-Length",len(strA));
            .setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
            .send   strA 
            End   With 
            Label1.Caption   =   "完成 " 
    End   Sub 试下,我没测试
      

  2.   


      strA ="address=AAAAAAAAAA" 
      Set http=CreateObject("MSXML2.XMLHTTP") 
      With   http 
        .open "POST ", "http://127.0.0.1/a.asp",False 
        .send strA 
    msgbox .responsebody
    '如果strA包含中文,要byteToString转换一下
      End With 
     
      Label1.Caption="完成 " 在页面顶部写!
    <% 
    if request.QueryString("address")<>"" then
      application("a")=request.QueryString("address")
      response.write application("a")
      response.end 
    %> 
      

  3.   

    2楼页面部分写错了:request.QueryString--->request.form
      

  4.   

    查了查资料,应该是中文编码的问题
    楼主尝试提交英文数据,或把中文字进行url编码:)
      

  5.   

    我想问一下这里HTTP如果在。NET中写这段代码的话,我需要定义成什么类型呢?