FormsAuthentication.HashPasswordForStoringInConfigFile 方法是一个在.NET 4.5中已经废弃不用的API,参见:

https://msdn.microsoft.com/zh-cn/library/system.web.security.formsauthentication.hashpasswordforstoringinconfigfile(v=vs.110).aspx

This is a solution for SH1 variant.

     public static string GetSwcSH1(string value)
{
SHA1 algorithm = SHA1.Create();
byte[] data = algorithm.ComputeHash(Encoding.UTF8.GetBytes(value));
string sh1 = "";
for (int i = ; i < data.Length; i++)
{
sh1 += data[i].ToString("x2").ToUpperInvariant();
}
return sh1;
}

For MD5 you only change algorithm to:

MD5 algorithm = MD5.Create();

参考:http://stackoverflow.com/questions/13527277/drop-in-replacement-for-formsauthentication-hashpasswordforstoringinconfigfile

最新文章

  1. 关于淘宝店铺装修弹出层popup的记录
  2. plsql解决中文乱码以及问号问题
  3. iOS软件版本更新思路
  4. C++内存分配方式
  5. [LA3026]Period
  6. System.out.println()输出到指定文件里
  7. I/B/P SP/SI
  8. 【转载】Oracle 11g R2 for Win7旗舰版(64位)- 安装
  9. PHP通过(PDO)Mysql表字段一键生成创建sqlite的SQL
  10. Js 命名空间注册方法
  11. 它们的定义TextView使之具有跑马灯的效果
  12. JAVA8,SPRING,ANGULARJS对项目
  13. /system改成可写
  14. C/C++预处理指令#define,#ifdef,#ifndef,#endif… (转)
  15. early_suspend【转】
  16. Luogu P2880 [USACO07JAN]平衡的阵容Balanced Lineup (ST表模板)
  17. rosetta mpi error: protocols.jobdist.JobDistributors:(0)Master Node -- Waiting for job request:tag=1
  18. 从头认识Spring-2.1 自己主动装配(2)-byType(2)
  19. RecyclerView的使用(2)之多Item布局的载入
  20. session的三种超时设置

热门文章

  1. 使用shell命令分析统计日志
  2. 使用Visual Studio 2010写Data Url生成工具C#版本
  3. MySQL Study之--Mysql无法启动“mysql.host”
  4. atittit.表单验证性质的原则和实施,以及选择和定义自己的兼容easyui dsl窗体身份验证规则
  5. BI—脚不一样的感觉
  6. Windows Phone APP中禁用截图
  7. java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.RuntimeException
  8. JAVA深入研究——Method的Invoke方法(转)
  9. jsp跳转后台代码页的简易方式~
  10. ActiveMQ与RabbitMQ采用camel综合