更新时间:2023-10-24 23:18:34
如果您尝试从该URL读取XML,则需要将链接指向xml文档,而不是
If you are trying to read the XML from that URL then you will need to have the link point to an xml document and not
OK: test_397_346<br>
这是无效的XML。您可以在以下网址 [ ^ ]使用XmlTextReader而不是XmlDocument
但是,如果你是试图将 str
解释为xml然后它无效 - 尝试将&符号&
更改为&安培; amp;
(删除空格 - 仅包括它们以阻止此编辑器将其更改为&)
您还需要文件的根节点,因此请尝试使用标签
例如
which is not valid XML. You can find more information on reading XML from a URL here[^] which uses XmlTextReader instead of XmlDocument
If however, you are trying to interpret str
as xml then it is not valid - try changing the ampersands &
to & amp ;
(remove the spaces - only included them to stop this editor changing it to &)
You also need a root node for the file so try surrounding the text with tags
e.g.
String str = "<url>https://mx.fortdigital.net/http/send-message?username=test&password=test&to=6593365219&from=FortDigital&message-type=sms.automatic&message=Message+Testing+Haloo</url>";
您正在使用加载
将文件名作为参数的方法,因此它试图将该文本作为文件打开 - 改为使用 LoadXml
。
You are using the Load
method that takes a filename as a parameter so it is trying to open that text as a file - use LoadXml
instead.