• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • .net下的MD5加密應用

    發表于:2009-11-03來源:作者:點擊數: 標簽:應用
    .net下的MD5加密應用 .net開發 關鍵字: C#用法 /**/ /// paramname="sDataIn" 需要加密的字符串 /param /// paramname="move" 偏移量 /param /// returns sDataIn加密后的字符串 /returns public string GetMD5( string sDataIn, string move) ... { System

    .net下的MD5加密應用  .net開發

    關鍵字:

    C#用法

        
    /// <param name="sDataIn">需要加密的字符串</param>
        
    /// <param name="move">偏移量</param>
        
    /// <returns>sDataIn加密后的字符串</returns>

        public string GetMD5(string sDataIn, string move)
        
    {
            System.Security.Cryptography.MD5CryptoServiceProvider md5 
    = new System.Security.Cryptography.MD5CryptoServiceProvider();
            
    byte[] bytValue, bytHash;
            bytValue 
    = System.Text.Encoding.UTF8.GetBytes(move + sDataIn);
            bytHash 
    = md5.ComputeHash(bytValue);
            md5.Clear();
            
    string sTemp = "";
            
    for (int i = 0; i < bytHash.Length; i++)
            
    {
                sTemp 
    += bytHash[i].ToString("x").PadLeft(2'0');
            }

            
    return sTemp;
    }


    textBox1.Text 
    = this.GetMD5("123456","");
    結果: e10adc3949ba59abbe56e057f20f883e
     另類應用
    C#用法

        
    /// <param name="sDataIn">需要加密的字符串</param>
        
    /// <param name="move">偏移量</param>
        
    /// <returns>sDataIn加密后的字符串</returns>

        public string GetMD5(string sDataIn, string move)
        
    {
            System.Security.Cryptography.MD5CryptoServiceProvider md5 
    = new System.Security.Cryptography.MD5CryptoServiceProvider();
            
    byte[] bytValue, bytHash;
            bytValue 
    = System.Text.Encoding.UTF8.GetBytes(move + sDataIn);
            bytHash 
    = md5.ComputeHash(bytValue);
            md5.Clear();
            
    string sTemp = "";
            
    for (int i = 0; i < bytHash.Length; i++)
            
    {
                sTemp 
    += bytHash[i].ToString("x").PadLeft(2'0');
            }

            
    return sTemp;
    }


    textBox1.Text 
    = this.GetMD5("123456","");
    結果: e10adc3949ba59abbe56e057f20f883e

     

     

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>