Util类运行时出现错误;
 public class Util
 {
  public static string Encrypt(string InnerCode)
  {
   return InnerCode;   byte[] bt= new Byte[InnerCode.Length];   for(int i=0;i<InnerCode.Length;i++)
   {
    bt[i]=(byte)InnerCode[i];
   }   HashAlgorithm thm=MD5.Create();
   byte[] btResult=thm.ComputeHash(bt);
   
   return System.Convert.ToBase64String(btResult); 
  }
 }错误出现在byte
byte[] bt= new Byte[InnerCode.Length];
具体错误为:Unreachable code detected
请大家帮忙解决

解决方案 »

  1.   

    把return InnerCode;放在第一句,后面的代码永远也不会执行到了,当然Unreachable了。
      

  2.   

    你要测试的话:
    public class Util
     {
      public static string Encrypt(string InnerCode)
      {
       return InnerCode;
    /*
       byte[] bt= new Byte[InnerCode.Length];   for(int i=0;i<InnerCode.Length;i++)
       {
        bt[i]=(byte)InnerCode[i];
       }   HashAlgorithm thm=MD5.Create();
       byte[] btResult=thm.ComputeHash(bt);
       
       return System.Convert.ToBase64String(btResult); 
    */
      }
     }