我从MSDN复制粘贴此代码:SHA1(和全加密命名空间)在Visual Studio 2012缺少
using System.Security.Cryptography;
byte[] buffer = enc.GetBytes(text);
SHA1CryptoServiceProvider cryptoTransformSHA1 =
new SHA1CryptoServiceProvider();
string hash = BitConverter.ToString(
cryptoTransformSHA1.ComputeHash(buffer)).Replace("-", "");
return hash;
但VS说,有没有这样的Cryptography
命名空间,因而不存在SHA1CryptoServiceProvider
类。
我在做什么错?
我在Windows 8 Release Preview上使用Visual Studio Professional 2012 RC和Dreamspark许可证。
你可以给该代码的链接? – aliboy38
它在那里。见MSDn http://msdn.microsoft.com/en-us/library/system.security.cryptography(v=vs.110).aspx –
可能没有解释我自己,我的意思是VS说他找不到那个类也不命名空间 –