/// <summary> /// byte转换Stream /// </summary> /// <param name="vs"></param> /// <returns></returns> public static Stream ToStream(byte[] vs) { Stream stream = new MemoryStream(vs); return stream; } /// <summary> /// Stream写入文件 /// </summary> /// <param name="stream"></param> /// <param name="FileName"></param> public static void SteramFile(Stream stream, string FileName) { byte[] vs = new byte[stream.Length]; stream.Read(vs, 0, vs.Length); stream.Seek(0, SeekOrigin.Begin); FileStream fileStream = new FileStream(FileName, FileMode.Create); BinaryWriter binary = new BinaryWriter(fileStream); binary.Write(vs); binary.Close(); }