<?php
echo md5("111111");
?>
这个结果就是96e79218965eb72c92a549dd5a330112

解决方案 »

  1.   

    我的意思是,你就别用phpbb的代码了呗。就用php自带的md5这个函数就行了。
      

  2.   

    这个php函数可以处理两种格式, md5 + ???
    根据传入的$hash判断使用那种
    你确定你php是在使用md5吗?
      

  3.   


    Php 自带了md5这个加密函数,不必那么麻烦.
      

  4.   

    php的只修改md5就好了。要修改.NET的,修改如下// 整个代码可能有大小写问题,
    protected string Md5(string source) 
            { 
                string result = ""; 
                System.Security.Cryptography.MD5 md5 = MD5 md5 = new MD5CryptoServiceProvider();
                byte[] temp = md5.ComputeHash(Encoding.utf8.GetBytes(source)); 
                result = BitConverter.tostring( temp ).replace("-", "").tolower();
                return result; 
            } 
      

  5.   

    由于匆忙,上面写错了,呵呵,应该是这样
    System.Security.Cryptography.MD5 md5 = new MD5CryptoServiceProvider();
      

  6.   

    md5
    PHP
    计算字符串的 MD5 哈稀。语法: string md5(string str);返回值: 字符串函数种类: 编码处理
    C#

    网上找到的一个,备查   ------------------------------------------------------------------------------------------------------------------- public string md5(string str, int code)
        {
            if (code == 16) //16位MD5加密(取32位加密的9~25字符)
            {
                return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower().Substring(8, 16);
            }        if (code == 32) //32位加密
            {
                return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower();
            }        return "00000000000000000000000000000000";
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (ListBox_16.Text.ToString().Trim().Length != 0)
            {
                string LockString16;         
                LockString16 = md5(ListBox_16.Text, 16);
                ListItem li = new ListItem(ListBox_16.Text.ToString() + "==>" + LockString16);
                this.ListBox_16.Items.Add(li);
                Response.Write(LockString16);
            }    }
      

  7.   

    给你个C#的:public static string md5String(string str)
            {
               //作为密码方式加密 并返回加密后的值
                return FormsAuthentication.HashPasswordForStoringInConfigFile(str.ToString().ToLower(), "MD5").ToLower();//默认生成的是大写
            }
      

  8.   

    再给个PHP的:
    <?php
    $str = "Hello";
    echo md5($str);
    ?>结果为:8b1a9953c4611296a827abf8c47804d7详细资料:http://www.fzs8.net/php/php_tutorial/2007-03-18/1286.html
      

  9.   

    补充一下:c#要使用这个功能, 需要引用:using System.Web.Security;public static string md5String(string str)
            {
               //作为密码方式加密 并返回加密后的值
                return FormsAuthentication.HashPasswordForStoringInConfigFile(str.ToString().ToLower(), "MD5").ToLower();//默认生成的是大写
            }
      

  10.   

    php 不是有 md5() 函数吗
      

  11.   


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

  12.   

    public  string md5String(string str)
            {
               //默认生成的是大写
                return FormsAuthentication.HashPasswordForStoringInConfigFile(str.ToString().ToLower(), "MD5").ToLower();//默认生成的是大写
            }
      

  13.   


    以字符串"123"的MD5加密来说:PHP代码:
          $s= md5("123");C#代码:
          String s= System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("123","MD5").ToLower();以上两个函数的返回值即:$s和s的值一样,都是:202cb962ac59075b964b07152d234b70
      

  14.   

    csdn的缓存时间设定是多少呢?