UrlEncode/System.Web 在控制台应用程序中不可用?
我的应用程序中需要 UrlEncode 因为我正在向我的应用程序提交表单服务器。我的应用程序是一个针对 .NET 3.5 的快速控制台实用程序。
该页面说我需要 System.Web 程序集,但是当我尝试添加引用时它不在那里。我的 WebServer 应用程序有它,它也针对 3.5,但此控制台应用程序无法引用它。为什么不呢?我如何访问 UrlEncode?
I need UrlEncode in my application because i am submitting a form to my server. My app is a quick console utility targeting to .NET 3.5.
The page says i need System.Web assembly, yet when i try to add the reference it isnt there. My WebServer application has it which is also targeted to 3.5 but this console app cant reference it. Why not? how can i access UrlEncode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以 - 只需确保添加了对 System.Web.dll 的引用,默认情况下它可能不在控制台项目中。
请注意,我怀疑这不在客户资料中 - 我不知道这对您来说是否是一个问题。
我刚刚从命令行使用控制台应用程序对此进行了测试:
我能够编译,
但我怀疑默认响应文件比 Visual Studio 中的默认控制台应用程序项目模板包含更多的程序集引用...
You can - just make sure you've added a reference to System.Web.dll, which may not be in a console project by default.
I suspect this isn't in the Client Profile, mind you - I don't know if that's an issue for you.
I've just tested this with a console app from the command line:
I was able to just compile with
but I suspect the default response file contains more assembly references than the default Console Application project template in Visual Studio...