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")
%>但是还是接到不到数据啊?什么原因,状态也完成了
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")
%>但是还是接到不到数据啊?什么原因,状态也完成了
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 试下,我没测试
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
%>
楼主尝试提交英文数据,或把中文字进行url编码:)