All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.Net生成一个简单的图片_[Asp.Net教程]
故障解决:PHPMyAdmin连接MYSQL的问题_php资料_编程技术
在,ASP.NET,2.0,中上载文件_[Asp.Net教程]
ASP.NET,2.0发送电子邮件全面剖析之二_.net资料_编程技术
限定GridView宽度并加上滚动条_[Asp.Net教程]
Visual,C#2005快速入门之声明bool变量_[Asp.Net教程]
C#中goto语句的使用方法
SQLServer,2008跨数据库实例事务处理_mssql学习_编程技术
sql server 如何复制数据库结构_[SQL Server教程]
浅析SQL,Server全文检索查询_mssql学习_编程技术
Reading number is top 10 pictures
西方气质的东方美女3
The cat shit
Sora aoi in China2
More attractive than sora aoi2
Summer is most suitable for young people to travel in China10
含苞欲放的素颜美少女2
Seductive beauty of crime1
Kim jong il's mistress, national beauty JinYuJi actor1
The terra-cotta warriors3
[猫扑大杂烩]华东师范墙上看到的捐精告示 15毫升3600元
Download software ranking
VC++6.0培训教程
虚拟机5.5.3版
功夫熊猫2(下集)
Unix video tutorial1
Boxer vs Yellow1
The Bermuda triangle1
Professional killers2 for Android
VeryCD电驴(EasyMule) V1.1.9 Build09081
Eclipse 4.2.2 For Win32
Tram sex maniac 2 (H) rar bag17
delv published in(发表于) 2014/1/16 9:29:32 Edit(编辑)
c#,MD5加密算法的实例_[Asp.Net教程]

c#,MD5加密算法的实例_[Asp.Net教程]

c# MD5加密算法的实例_[Asp.Net教程]


环境:vs.net2005/sql server2000/xp测试通过
1.MD5 16位加密实例
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;

namespace md5
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(UserMd5("8"));
Console.WriteLine(GetMd5Str("8"));
}
/**////
/// MD5 16位加密
///

///
///
public static string GetMd5Str(string ConvertString)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8);
t2 = t2.Replace("-", "");
return t2;
}

/**////
/// MD5 32位加密
///

///
///
static string UserMd5(string str)
{
string cl = str;
string pwd = "";
MD5 md5 = MD5.Create();//实例化一个md5对像
// 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择 
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
// 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得
for (int i = 0; i < s.Length; i++)
{
// 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母,如果使用大写(X)则格式后的字符是大写字符

pwd = pwd + s[i].ToString("X");

}
return pwd;
}
}
}

http://www.cnblogs.com/sopper/archive/2007/01/08/615111.html







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.