System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)已过时的解决办法
2024-08-20 08:24:50
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
最新文章
- 关于淘宝店铺装修弹出层popup的记录
- plsql解决中文乱码以及问号问题
- iOS软件版本更新思路
- C++内存分配方式
- [LA3026]Period
- System.out.println()输出到指定文件里
- I/B/P SP/SI
- 【转载】Oracle 11g R2 for Win7旗舰版(64位)- 安装
- PHP通过(PDO)Mysql表字段一键生成创建sqlite的SQL
- Js 命名空间注册方法
- 它们的定义TextView使之具有跑马灯的效果
- JAVA8,SPRING,ANGULARJS对项目
- /system改成可写
- C/C++预处理指令#define,#ifdef,#ifndef,#endif… (转)
- early_suspend【转】
- Luogu P2880 [USACO07JAN]平衡的阵容Balanced Lineup (ST表模板)
- rosetta mpi error: protocols.jobdist.JobDistributors:(0)Master Node -- Waiting for job request:tag=1
- 从头认识Spring-2.1 自己主动装配(2)-byType(2)
- RecyclerView的使用(2)之多Item布局的载入
- session的三种超时设置
热门文章
- 使用shell命令分析统计日志
- 使用Visual Studio 2010写Data Url生成工具C#版本
- MySQL Study之--Mysql无法启动“mysql.host”
- atittit.表单验证性质的原则和实施,以及选择和定义自己的兼容easyui dsl窗体身份验证规则
- BI—脚不一样的感觉
- Windows Phone APP中禁用截图
- java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.RuntimeException
- JAVA深入研究——Method的Invoke方法(转)
- jsp跳转后台代码页的简易方式~
- ActiveMQ与RabbitMQ采用camel综合