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

Reading number is top 10 articles
asp.net2.0导出pdf文件完美解决方案_[Asp.Net教程]
.NET,2.0,SqlDependency快速上手指南_[Asp.Net教程]
使用,C#,编程对,RTF,文档进行操作_.net资料_编程技术
在c#中如何操作文本文件_[Asp.Net教程]
c#中二维数组的使用
C#中WebBrower控件应用实例
数据库的分页问题_[SQL Server教程]
Asp.net(c#)数据库操作类_[Asp.Net教程]
XML入门教程-使用CSS显示XML_[XML教程]
AJAX的jQuery实现入门(一)_[AJAX教程]
Reading number is top 10 pictures
含苞欲放的素颜美少女2
Chinese paper-cut grilles art appreciation8
看如何给单纯的少女洗脑
Absolutely shocked. National geographic 50 animal photographys4
Poor doll, hand job was caught the currently in effect by his dad
鸡蛋的新玩法
可爱的狗熊们
接财神,大吉大利,财源滚滚来
The little girl with long hair2
到南昌西站了3
Download software ranking
Unix video tutorial3
linux初级教程
Tram sex maniac 2 (H) rar bag8
Twenty piece of palm leaf
C#与.NET技术平台实战演练
Ashlynn Video4
Take off clothes to survival
The hero
Macromedia Dreamweaver 8
Unix video tutorial10
delv published in(发表于) 2014/1/10 6:28:51 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;
}
http://www.cnblogs.com/sopper/archive/2007/01/08/615111.html
/**////
/// 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/54tiger/archive/2007/01/10/616656.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.