souce: if you know, please tell me. thanks!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.Cryptography;
/// <summary>
/// function to generate MD5
/// </summary>
/// <param name="inStr"></param>
/// <returns></returns>
private string calculatemd5(string inStr)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] InBytes = Encoding.GetEncoding("GB2312").GetBytes(inStr);
byte[] OutBytes = md5.ComputeHash(InBytes);
string OutString = "";
for (int i = 0; i < OutBytes.Length; i++)
{
OutString += OutBytes[i].ToString("x2");
}
return OutString;
}