
des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfig
以上代码在winform中,老是报如下错误,
错误 2 命名空间“System.Web”中不存在类型或命名空间名称“Security”。是否缺少程序集引用?
解决方法:
首先确保你使用的是完整版的.net框架,在项目-属性-目标框架中,下拉选择的不是.net 4.0 client profile而是.net framework 4.0。然后在项目-添加引用中添加对system.web的引用。