MD5加密

加密密码

 

第一种方法: 添加引用system.web

添加命名空间using System.Web.Security;

string result=FormsAuthentication.HashPasswordForStoringInConfigFile(this.textBox1.Text,"MD5");

第二种方法:添加命名空间using   Sytem.Security.Cryptography;    using   System.Text;

System.Security.Cryptography.MD5 md5=new MD5CryptoServiceProvider();

byte[] old=Encoding.Default.GetBytes(this.textBox2.Text);

byte[] aaa=md5.ComputeHash(old);

string result=BitConverter.ToString(aaa).Replace("-","")

posted @   kuangx  阅读(223)  评论(0编辑  收藏  举报
编辑推荐:
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· DeepSeek 解答了困扰我五年的技术问题
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
阅读排行:
· 为DeepSeek添加本地知识库
· 精选4款基于.NET开源、功能强大的通讯调试工具
· DeepSeek智能编程
· 大模型工具KTransformer的安装
· [计算机/硬件/GPU] 显卡
点击右上角即可分享
微信分享提示