[ASP.NET2.0]Common层通用代码之MD5
来源:互联网 发布:android pda扫描源码 编辑:程序博客网 时间:2024/04/30 10:36
using System;
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Security.Principal;
using System.Security.Cryptography;
namespace Common
...{
public class MD5
...{
public static string Encrypt(string password)
...{
/**////获取Byte数组
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
/**////获取Hash值
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
/**////获取加密后的信息
return BitConverter.ToString(hashedBytes);
}
}
}
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Security.Principal;
using System.Security.Cryptography;
namespace Common
...{
public class MD5
...{
public static string Encrypt(string password)
...{
/**////获取Byte数组
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
/**////获取Hash值
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
/**////获取加密后的信息
return BitConverter.ToString(hashedBytes);
}
}
}
- [ASP.NET2.0]Common层通用代码之MD5
- [ASP.NET2.0]Common层通用代码之数据库访问
- [ASP.NET2.0]Common层通用代码之Week枚举
- [ASP.NET2.0]Common层通用代码之字符串处理
- [ASP.NET2.0]Common层通用代码之加密解密
- [ASP.NET2.0]Common层通用代码之JavaScript弹出信息框
- [ASP.NET2.0]Common层通用代码之JavaScript弹出新窗体
- [ASP.NET2.0]Common层通用代码之JavaScript脚本输出
- [ASP.NET2.0]Common层通用代码之服务器端正则表达式验证
- [ASP.NET1.1]Common层通用代码之树型控件递归加入子项方法
- Common层通用代码之服务器端正则表达式验证
- Asp.net2.0MD5加密
- ASP.NET2.0学习5--N层代码示例
- ASP.NET2.0学习5--N层代码示例
- ASP.NET2.0学习5--N层代码示例
- ASP.NET2.0学习5--N层代码示例
- ASP.NET2.0学习--N层代码示例
- ASP.NET2.0学习--N层代码示例
- __declspec(dllexport)的意思
- sap
- 回调函数
- [ASP.NET2.0]Common层通用代码之数据库访问
- 成年人必看的六个故事教你学会做人
- [ASP.NET2.0]Common层通用代码之MD5
- 又一个人去了
- 自责
- dephi中使用ADOQuery书写SQL语句的一点技巧
- 对倒出货
- 利用xdoclet开发hibernate3的ant通用代码
- 一步一步SharePoint 2007
- [ASP.NET2.0]Common层通用代码之JavaScript弹出信息框
- VS2005-ASP.NET的网格布局