如何使用winforms中的HttpUtility.UrlEncode [英] How do use HttpUtility.UrlEncode from winforms
本文介绍了如何使用winforms中的HttpUtility.UrlEncode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在winform中使用HttpUtility.UrlEncode方法。但是,来自
System.Web的intellisense中没有HttpUtility类。
。为了能够使用这种方法,我需要做什么?我正在使用visual studio 2010
解决方案
您还应该可以使用Uri.EscapeUriString()
http://msdn.microsoft.com/en-us/library/system.uri .escapeuristring.aspx [ ^ ]
但是,System.Web应该可以工作,但你必须添加对它的引用,而不仅仅是使用它来声明它。
I need to use the HttpUtility.UrlEncode method in a winform. However,
the HttpUtility class is not available in intellisense from
System.Web. What do I need to do to be able to use this method? I am using visual studio 2010
解决方案
You should also be able to use Uri.EscapeUriString()
http://msdn.microsoft.com/en-us/library/system.uri.escapeuristring.aspx[^]
However, System.Web should work but you'll have to add a reference to it, not just declare it with using.
这篇关于如何使用winforms中的HttpUtility.UrlEncode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文