xml - 将 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)
解决方案
推荐阅读
- asp.net - 当我只有 child-id 和 reverse 时,如何选择所有 Child 和 parent 的模型?
- java - 制作布告栏 Android Studio
- c# - 如何在 DataGrid 列上添加 Avalonia 下拉过滤器?
- python - python-netcdf4:替换组中的变量及其维度
- python - 无效的矩形分配
- python - Convert json response object to pandas data frame
- python-3.x - 使用 Tensorflow 预测单张图像不准确
- flutter - 使工具提示在飞镖颤动中跟随鼠标
- javascript - 在输入时通过自动完成材料 ui 的文本框选择多个值
- python - 如何在没有代码等待 discord.py 的情况下等待消息