Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想得到一个 xml 标签,如:
<link url="http://www.xxx.com/?&q=xxx">xxx</link>
但是SetAttribute方法更改&为&,我该如何防止呢?
SetAttribute
&
&
我的代码:
XmlElement Link = doc.CreateElement("Link"); Link2.SetAttribute("url", "http://www.xxx.com/?&q=xxxx");
请帮我 !谢谢!
查看此wiki 文章以查看也必须转义的其他字符。它还描述了原因。