惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
雷峰网
雷峰网
V
Visual Studio Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
月光博客
月光博客
A
About on SuperTechFans
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale

博客园 - teacherzj

EF---延迟加载技术 Entity Framework 1 委托 xml 可扩展的标记语言 单例模式 集合,对象初始化器 序列化与反序列化 进程与线程 winform基础 接口 重写ToString()方法 密封类 部分类 序列化和反序列化 值类型和引用类型 简单工厂模式 C#中的访问修饰符 多态 FileStream、StreamReader和StreamWriter
MD5加密
teacherzj · 2014-12-28 · via 博客园 - teacherzj

string str="123";

string codeStr=GetMD5("123");

public static string GetMD5(stirng str)
{
//创建MD5对象
MD5 md5=MD5.Create();
//开始加密
//需要将字符处转换成字节数组
byte[] buffer=Encoding.Default.GetBytes(str);
//返回一个加密好的字节数组
byte[] MD5Buffer=md2.ComputeHash(buffer);
//将字节数组转换成字符串
string strNew="";
for(int i=0;i<MD5Buffer.Length;i++)
{
str+=MD5Buffer[i].ToString("X2");
}
return strNew;
}