Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual c++ 如何使用ifstream.open()和read()方法从未压缩的.docx文件中获取内容。officeopenxml,vc++;_Visual C++_Openxml_Ifstream - Fatal编程技术网

Visual c++ 如何使用ifstream.open()和read()方法从未压缩的.docx文件中获取内容。officeopenxml,vc++;

Visual c++ 如何使用ifstream.open()和read()方法从未压缩的.docx文件中获取内容。officeopenxml,vc++;,visual-c++,openxml,ifstream,Visual C++,Openxml,Ifstream,我正在尝试从.docx文件构建后缀树 因此,首先我解压缩了.docx文件,然后再次创建了一个.docx文件,但没有对其进行压缩。我使用了ICSharpCode.SharpZipLib.Zip.ZipOutputStream.SetLevel(0)方法。这里我用的是C 此未压缩的.docx文件可以在没有任何错误的情况下打开 下一步我使用vc++。通过使用ifstream.open(“uncompressed.docx”,ios::binary);方法我尝试使用ifstream.read((char

我正在尝试从.docx文件构建后缀树

因此,首先我解压缩了.docx文件,然后再次创建了一个.docx文件,但没有对其进行压缩。我使用了ICSharpCode.SharpZipLib.Zip.ZipOutputStream.SetLevel(0)方法。这里我用的是C

此未压缩的.docx文件可以在没有任何错误的情况下打开

下一步我使用vc++。通过使用ifstream.open(“uncompressed.docx”,ios::binary);方法我尝试使用ifstream.read((char*)T,MAX_LENGTH-1)方法打开文件并将内容存储在char数组中。但我无法获得uncompressed.docx文件的实际内容。当我试图打印char数组(T)的内容时,它打印了一些格式化标记,而不是打印uncompressed.docx的实际文本内容

我无法确定ifstream.open()方法打开的实际文件是什么。它不是document.xml文件


请告诉我如何使用VC++从未压缩的.docx文件中获取实际文本内容

xml文件是一个xml文档,实际上有很多“格式化标记”。你想打开什么文件?我想打开未压缩的.docx文件。不是document.xml文件。解压压缩的.docx文件后,它包含一些xml文件,包括document.xml文件。但我没有打开它。我没有压缩文件夹,而是压缩了它,然后又创建了一个未压缩版本的.docx文件。我不明白。docx是文件的集合。文档的文本位于其中一个文件中,以XML格式存储。如果您试图“打开”一个重命名为.docx的压缩文件夹,您将无法获得实际文本。感谢您的回复。当我们使用ifstream.open(“somename.docx”,ios::binary)方法打开一个普通的.docx文件时,它打开的确切文件是什么?它打开文件somename.docx,就像打开“foo.zip”、“bar.jar”或“foobar.cab”一样。