Reg.aspx和md5.asp在同一目录中,mdb5.asp里有个md5加密函数,
请教高手怎样才能在Reg.vb中调用MD5.asp里的md5函数给读取的数据加密?

解决方案 »

  1.   

    不用调用
    .net 中有自带的MD5加密函数!·
      

  2.   

    ms-help://MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfSystemSecurityCryptographyMD5ClassTopic.htm
      

  3.   

    using System.Web.Security;FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5")
      

  4.   

    在Page_Load中
    ....
    string scriptString = @"<script language='JavaScript'>";
    scriptString +=  "md5();";
    scriptString +=  "</script>";
    if(!this.IsStartupScriptRegistered("Startup"))
    this.RegisterStartupScript("Startup", scriptString);
    ....
      

  5.   

    试试这个吧,兄弟
    using System;
    using System.Text;
    using System.Security.Cryptography;
    //把用户的密码Md5加密后化成一个Byte型的值
    public static byte[] EnCryPassword(string pwd)
    {
    byte[] key=Encoding.Unicode.GetBytes(pwd);
    MD5CryptoServiceProvider md5=new  MD5CryptoServiceProvider();
    byte[] encry=md5.ComputeHash(key);
    return encry;
    }
      

  6.   

    你最好把加密函数md5放到一个单独的类文件.vb中,并设上命名空间a,
    使用的时候
    imports a调用a.md5即可!