using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Security.Cryptography;
/// <summary>
/// Author:liguoqing
/// Create Date:2009-12-2
/// Description:数据显示层公共类
/// </summary>
public class Common
{
/**********************************************************************************************************************************************************/
/// <summary>
/// MD5数据加密
/// </summary>
/// <param name="sql">加密前的数据</param>
/// <returns>加密后的数据</returns>
public static string StrMD5(Object obj)
{
MD5 md5 = new MD5CryptoServiceProvider();//初始化MD5加密类的实例
byte[] byteData = System.Text.Encoding.Default.GetBytes(obj.ToString());//转化为byte数组类型并转码
byte[] md5Data = md5.ComputeHash(byteData);//指定字节数组的哈希值进行加密
return BitConverter.ToString(md5Data).Replace("-", "");//将数组再转换为string 类型
}
/**********************************************************************************************************************************************************/
}