关于ServerXMLHttp返回数据的乱码问题
在excel中定义宏如下:
Sub opost() Set objhttp = CreateObject("MSXML2.ServerXMLHTTP") Dim URL Dim data URL = "http://127.0.0.1/test/test.asp" objhttp.Open "POST", URL, False 'objhttp.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" objhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objhttp.send ("id=1") data = objhttp.responseText Cells(1, 1).Value = dataEnd Sub
<% dim id id = request.Form("id") response.write id%>