using System;
using System.IO;
using System.Text;
using System.Security;
using System.Web.Security;//这个命名空间明明有的,他还是报错..为什么啊?
using System.Security.Cryptography;
namespace Test
{
public class Security
{
public string EncryptPassword(string PasswordString, string PasswordFormat)
{
string encryptPassword = null;
if (PasswordFormat == "SHA1")
{
encryptPassword = FormsAuthorication.HashPasswordForStoringInConfigFile(PasswordString, "SHA1");
}
else if (PasswordFormat == "MD5")
{
encryptPassword =FormsAuthorication.HashPasswordForStoringInConfigFile(PasswordString, "SHA1");
}
return encryptPassword;
}
}
}
建一个项目,添加这个类,运行的时候报错...要怎么改才正确呢?谢谢!
不不是没有引用?
要引用.NET的System.Web;组件,而不只是引用System.Web命名空间.
string encryptPassword = null;
aaa