首页 > 解决方案 > 将 MSXML2.XMLHTTP 从经典 ASP 转换为 VB.NET

问题描述

我有一个将 ASP 经典网页转换为 VB.NET 页面的项目,并且有一个我很难转换的功能。请帮助我 VB.NET 的等效代码是什么

Function GetSHA1(strKey)
Dim returnString, SoapPara, SoapURL

Set SoapRequest = Server.CreateObject("MSXML2.XMLHTTP.3.0") 
Set myXML =Server.CreateObject("MSXML.DOMDocument")

myXML.Async=False

SoapPara = "Key=" & strKey


If SoapPara <> "" Then

    SoapURL = "http://URL" & SoapPara


    SoapRequest.Open "GET",SoapURL , False 
    SoapRequest.Send()
    if Not myXML.load(SoapRequest.responseXML) then 
        GetSHA1 = "" 
    Else  
        Set nodesDecimal=myXML.documentElement.selectNodes("//string") 
        GetSHA1 = nodesDecimal(0).text
    end if

    Set SoapRequest = Nothing 
    Set myXML = Nothing

End If
End Function

 set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
 set xmlhttp = nothing 

ipay_post_url = chr(34) & "url"  & chr(34)

标签: xmlvb.netasp-classic

解决方案


推荐阅读