如何从字节数组加载Word文档

mat*_*nik 6 c# ms-word extract office-interop

我将整个MS Word文件本身保存到一个字节数组中.想要以我在文件系统上的方式加载它,但是使用最少的Microsoft.Office.Interop.Word,因为它很慢这.Open(args[]) 部分.

Ara*_*san 4

尝试这个....

      byte[] bte = File.ReadAllBytes("E:\\test.doc"); // Put the Reading file
        File.WriteAllBytes(@"E:\\test1.doc", bte); // Same contents you will get in byte[] and that will be save here 
Run Code Online (Sandbox Code Playgroud)

  • 它仍然使用文件系统 I/O。我相信作者正在寻找一种将“byte[]”保留在内存中而不将文件写入磁盘的解决方案? (3认同)