替代HttpUtility的.NET 3.5 SP1客户端框架? [英] Alternative to HttpUtility for .NET 3.5 SP1 client framework?

查看:249
本文介绍了替代HttpUtility的.NET 3.5 SP1客户端框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这将会是非常好的来定位我的Windows窗体应用程序到.NET 3.5 SP1的客户的框架。但是,现在我使用 HttpUtility.HtmlDe code HttpUtility.UrlDe code 功能和MSDN文档不指向任何替代品里面,比方说,System.Net什么的。

It'd be really nice to target my Windows Forms app to the .NET 3.5 SP1 client framework. But, right now I'm using the HttpUtility.HtmlDecode and HttpUtility.UrlDecode functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something.

因此​​,短距离reflectoring源$ C ​​$ C并将其复制到我的组装---我不觉得这是值得的---有没有替代品的.NET 3.5 SP1客户端框架内,你知道,更换这个功能?这似乎有点奇怪,他们会限制这些有用的功能服务器仅code。

So, short from reflectoring the source code and copying it into my assembly---which I don't think would be worth it---are there alternatives inside of the .NET 3.5 SP1 client framework that you know of, to replace this functionality? It seems a bit strange that they'd restrict these useful functions to server-only code.

推荐答案

我强烈建议不要滚动您自己的编码。我会使用微软反跨站点脚本库这是非常小的(1.5版是〜30KB),如果HttpUtility.HtmlEn code是不可用的。

I’d strongly not recommend rolling your own encoding. I’d use the Microsoft Anti-Cross Site Scripting Library which is very small (v1.5 is ~30kb) if HttpUtility.HtmlEncode isn’t available.

至于解码,也许你可以使用从解码程序<一href="http://www.koders.com/csharp/fid1A50096D8FA38302680B0EEDAC5B1CE1AEA855D0.aspx?s=%22Lawrence+Pit%22"相对=nofollow>单?

As for decoding, maybe you could use the decoding routine from Mono?

这篇关于替代HttpUtility的.NET 3.5 SP1客户端框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆