当前位置:编程学习 > C#/ASP.NET >>

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 --------------------编程问答--------------------
引用 3 楼 whycom 的回复:
添加对system.web.dll的引用

正解 --------------------编程问答-------------------- 学习了 --------------------编程问答--------------------
引用 6 楼 xiaofei0804 的回复:
项目里面引用→添加引用→选中system.web
--------------------编程问答--------------------
引用 3 楼 whycom 的回复:
添加对system.web.dll的引用
或者csc /r:system.web.dll --------------------编程问答-------------------- 学习了
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,