如何把64进制转化位2进制?要求用C#实现。
最好是给出代码,253各位高手了

解决方案 »

  1.   

    64进制如何标识呢?
    0~9,A~Z,a~z,这才62个字符。64进制如何标示说了先
      

  2.   

    下面的示例说明如何使用 FromBase64String 方法对以 UUencode(基 64)编码的数据进行解码并将它保存为二进制输出。public void DecodeWithString()
    {
      System.IO.StreamReader inFile;
      string base64String;  try
      {
        char[] base64CharArray;
        inFile = new System.IO.StreamReader(inputFileName,
                        System.Text.Encoding.ASCII);
        base64CharArray = new char[inFile.BaseStream.Length];
        inFile.Read(base64CharArray, 0, (int)inFile.BaseStream.Length);
        base64String = new string(base64CharArray);
      }
      catch (System.Exception exp)
      {
        // Error creating stream or reading from it.
        System.Console.WriteLine("{0}", exp.Message);
        return;
      }  // Convert the Base64 UUEncoded input into binary output.
      byte[] binaryData;
      try
      {
        binaryData =
          System.Convert.FromBase64String(base64String);
      }
      catch (System.ArgumentNullException)
      {
        System.Console.WriteLine("Base 64 string is null.");
        return;
      }
      catch (System.FormatException)
      {
        System.Console.WriteLine("Base 64 string length is not " +
          "4 or is not an even multiple of 4." );
        return;
      }  // Write out the decoded data.
      System.IO.FileStream outFile;
      try
      {
        outFile = new System.IO.FileStream(outputFileName,
                           System.IO.FileMode.Create,
                           System.IO.FileAccess.Write);
        outFile.Write(binaryData, 0, binaryData.Length);
        outFile.Close();
      }
      catch (System.Exception exp)
      {
        // Error creating stream or writing to it.
        System.Console.WriteLine("{0}", exp.Message);
      }
    }
      

  3.   

    public static byte[] FromBase64String(string s);将指定的由以 64 为基的数字组成的值的 String 表示形式转换为等效的 8 位无符号整数数组。s 的长度(忽略空白字符)必须是 4 的偶数倍。s 由基 64 数字、空白字符和尾随填充字符组成。从零开始以升序排列的以 64 为基的数字为大写字符“A”到“Z”、小写字符“a”到“z”、数字“0”到“9”以及符号“+”和“/”。空白字符为 Tab、空格、回车和换行。s 中可以出现任意数目的空白字符,因为所有空白字符都将被忽略。无值字符“=”用于尾部的空白。s 的末尾可以包含零个、一个或两个填充字符。