Escape URL - XML - Live Tile - UWP

时间:2016-04-04 10:50:04

标签: xml win-universal-app windows-10 live-tile unicode-escapes

在C#中我有System.Security.SecurityElement.Escape(url),但在我的BackgroundTask中我没有访问它。  我试试了:

url= url.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");

但这种方式非常无聊。有没有办法用本机方法做到这一点?就像我写的第一个。

UrlEncode不适用于我,只需要转义网址。

(我基于此链接:http://weblogs.sqlteam.com/mladenp/archive/2008/10/21/Different-ways-how-to-escape-an-XML-string-in-C.aspx

有什么想法吗?

提前致谢

0 个答案:

没有答案