C#控制台程序怎样使用using System.Web.Security中的类?
我编写了C#控制台程序, 想使用using System.Web.Security中的类,我把using System.Web.Security复制到自己的代码中,可是仍然不能使用using System.Web.Security中的类,怎么办?? --------------------编程问答-------------------- 那是专为Web应用程序写的类库,控制台用HttpWebRequest的方式去写.
另外,"System.Web.Security复制到自己的代码中"是什么意思,要添加引用的 --------------------编程问答-------------------- "System.Web.Security复制到自己的代码中"
我的意思是说:为了能使用System.Web.Security中的类,我把它作为引用添加到控制台程序的代码最前头几行了。即:
using System;
using ....;
using System.Web.Security;
但是还不能使用System.Web.Security中的类。 --------------------编程问答-------------------- 添加对system.web.dll的引用 --------------------编程问答-------------------- 另外补充一下:我引用System.Web.Security的目的是想使用里面的加密函数:
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile,在控制台程序中我该怎么才能使用这个函数呢? --------------------编程问答-------------------- 项目里面的引用加了没有?不光是using就可以的,要把System.Web这个类库引用进来 --------------------编程问答-------------------- 项目里面引用→添加引用→选中system.web --------------------编程问答--------------------
正解 --------------------编程问答-------------------- 学习了 --------------------编程问答-------------------- --------------------编程问答-------------------- 或者csc /r:system.web.dll --------------------编程问答-------------------- 学习了
补充:.NET技术 , C#