从数据库里面读出来了一条二进制的数据流,因为数据流被加密了,所以也不知道它的类型是什么,目前只想把这个二进制数据流直接的存成一个文件(存成什么文件无所谓),请问怎么做到?

解决方案 »

  1.   

    用什么函数存呢,在C#里面,我找了很久没有找到先读到了dataReader dr 里面
    然后用MemoryStream ms = new MemoryStream((byte[])dr["二进制"])
    再然后用什么存呢?
      

  2.   

     System.IO.File.WriteAllBytes(path, bytes);
      

  3.   

    我用的是.net 2003 ,怎么一直都找不到File下面的WriteAllBytes这个函数
      

  4.   

     byte[] _Bytes =new byte[100];
                _Bytes[0]=0xFF;
                System.IO.FileStream _File = new System.IO.FileStream(@"C:\1.dat", System.IO.FileMode.Create);
                _File.Write(_Bytes, 0, _Bytes.Length);
                _File.Close();