sách gpt4 ăn đã đi

asp.net - xml 响应 http post - 将 request.inputstream 转换为字符串 - asp.net

In lại 作者:数据小太阳 更新时间:2023-10-29 02:36:45 27 4
mua khóa gpt4 giày nike

我收到了一个 xml 响应,我现在想解析它。

目前我必须接收的 XML 响应是:

    Dim textReader = New IO.StreamReader(Request.InputStream)

Request.InputStream.Seek(0, IO.SeekOrigin.Begin)
textReader.DiscardBufferedData()

Dim Xmlin = XDocument.Load(textReader)

现在我该如何继续处理并挑选出元素值?


abc123
active

Joe
bloggs
Bloggs inc
1234567890
joebloggs@hotmail.com


如果我有它的字符串格式,我可以使用

    Dim xmlE As XElement = XElement.Parse(strXML) ' strXML is string version of XML

Dim strRef As String = xmlE.Element("reference")

我需要将 request.inputstream 转换为 strign 格式还是有其他更好的方法?

Cảm ơn

câu trả lời hay nhất

Do I need to convert the request.inputstream to a strign format or is there another better way?

您可以直接从请求流中加载它,不需要将它转换为字符串:

Request.InputStream.Position = 0
Dim Xmlin = XDocument.Load(Request.InputStream)
Dim reference = Xmlin.Element("subscription").Element("reference").Value

或:

Dim reference = Xmlin.Descendants("reference").First().Value

关于asp.net - xml 响应 http post - 将 request.inputstream 转换为字符串 - asp.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11092666/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress