此代码在良好的旧 VB6 中运行良好。我已经尝试了各种方法在 VB.NET 中执行此操作,但无法使其正常工作。任何人都可以帮我编写在 .NET 中工作的代码吗?
Dim objHTTP As New MSXML2.XMLHTTP
Dim strReturn As String
Dim objReturn As New MSXML2.DOMDocument
Dim url As String
Dim XMLEnvelope As String
url = "http://zzzzzdummy.com"
XMLEnvelope = vbNull
objHTTP.open("post", url, False, "", "") '
Debug.Print(Err.Number)
objHTTP.setRequestHeader("Content-Type", "text/xml")
objHTTP.setRequestHeader("Content-length", Len(XMLEnvelope))
Debug.Print("------------Send Envelope-------------")
Debug.Print(XMLEnvelope)
Debug.Print("--------------------------------------")
objHTTP.send(XMLEnvelope)
strReturn = objHTTP.responseText
objReturn.loadXML(strReturn)
Debug.Print("----------Response Envelope-----------")
Debug.Print(strReturn)
Debug.Print("--------------------------------------")