日期:2014-05-19  浏览次数:20942 次

vs2005使用md5的问题,vs2003可以
试用了很多md5的代码,包括自己以前在vs2003下使用的,都不行,提示出错:

错误 1 “ASP.test_aspx.GetTypeHashCode()”:   没有找到适合的方法来重写 c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary   ASP.NET   Files\tpworks\ed79be1e\e5e090a1\App_Web_5ty_il-2.0.cs

错误 2 “ASP.test_aspx.ProcessRequest(System.Web.HttpContext)”:   没有找到适合的方法来重写 c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary   ASP.NET   Files\tpworks\ed79be1e\e5e090a1\App_Web_5ty_il-2.0.cs

错误 3 “ASP.test_aspx”不会实现接口成员“System.Web.IHttpHandler.IsReusable” c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary   ASP.NET   Files\tpworks\ed79be1e\e5e090a1\App_Web_5ty_il-2.0.cs

错误 4 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如   Page   或   UserControl)是正确的。 D:\net\IIS\TPWorks\test.aspx.cs 16 33 D:\...\TPWorks\


代码1:

#region   公用加密类
public   class   EncryptPwd

{

public   string   md5(string   str,int   code)   //   md5加密函数
{  

if(code==16)  
{  
return   System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5 ").ToLower().Substring(8,16)   ;  
}  

if(code==32)  
{  
return   System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5 ");  
}  

return   "00000000000000000000000000000000 ";  
}  


public   string   sha1(string   str)     //   SHA加密函数
{
return   System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str   , "SHA1 ");  
}

}
#endregion

代码2:

                private   string   GetStringValue(byte[]   Byte)
                {
                        string   tmpString   =   " ";

                        if   (this.isReturnNum   ==   false)
                        {
                                StringBuilder   sBuilder   =   new   StringBuilder();

                                for   (int   i   =   0;   i   <   Byte.Length;   i++)
                                {
                                        sBuilder.Append(Byte[i].ToString( "x2 "));
                                }

                                tmpString   =   sBuilder.ToString();
                        }
                    &n