试图阅读MS word文件 [英] Trying to read MS word file

查看:98
本文介绍了试图阅读MS word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正试图通过以下代码从服务器路径读取ms word文件:

Hi I am trying to read ms word file from server path by following code :

string wordHTML = System.IO.File.ReadAllText(path);



但内容显示如下。请建议阅读word文件内容。




but the content is showing like this.Please suggest to read word file content as it is.

PK!�t+d�7[Content_Types].xml �(��T�N�0�#���(q�!Դ�#�D�Ǚ�o���mT�Im/�b�-�f2��Z�h ��S�Oz$�M.�,%�ӗ��D>0�3i4�d����W��Ƃ��}J�!�J=��b>14��)��ͨe��̀��zw�@�8�d8x��-d���x�ub��D���J��U��sz�	��������ѥ�؊MQ���f#a�} ���������	?��`0 ����+����,'r�&̅W�0�2.�u!�4�A�l���(��̊	����C/T��ٍ�ԝ&|�H��w��m�ǰ&�XO�w'�C�C���.��1!`��(~��V~5�����?9���S��U1e����~�M�ib����? o3R�7�a�wV�>2u�Z��/��PK!���N_rels/.rels �(����JA���a�}7� "���H�w"����w̤ھ�� �P�^����O֛���;�<�aYՠ؛`G�kxm��PY�[��g Gΰino�/<���<�1��ⳆA$>"f3��\�ȾT��I S����������W����Y ig�@��X6_�]7~ f��ˉ�ao�.b*lI�r�j)�,l0�%��b� 6�i���D�_���,	� ���|u�Z^t٢yǯ;!Y,}{�C��/h>��PK!-w�9�word/_rels/document.xml.rels �(����N�0��&��] ���,�Ř��D� P�-igU��q7l��K��7��/3���ߪ >�:it��0b�”R�	{˞��Y�P�R�FC�zpl�^^�^�H�\#;��v k��]р.4h:��U��5�D�!j�(Zr;�`�g�)f7%�g}G��{���<�b�@���d(l ��]��@?�p��"u׍e��'Be4f"o'��9��O�}K�iƾ���}����� F�A��X��0-<��P��U�����i�R�{��>����a�R����̂��d����ώL��t������PK!y�(�+�9word/document.xml�}�n�H����*�lZ�-g:/�f����پ���Ec��!�i�T�b��W��'`��%�Q�I�;AR")�&%Y&�H��6%Q��s?�9��>2ٝp\ö�j��^�	K�u�վ^�y_c��-���%�jS�����?��O�C�����<�[X��^z��pw�Նb�݆=^��Έ{��쎸s�w4{4�qc��7����{[oc�|�:o�324�v�G9��}C��N�� >y>���]G�x�r��؍�6Z�nX�





我尝试过:





What I have tried:

string wordHTML = System.IO.File.ReadAllText(path);

推荐答案

? M. ,% ӗ D>0 3i4 d? W Ƃ ?}ĴJ = b个!?????1 4)EZW ?? @ 8 d8x-DX ub D J ?U sz? ? ѥ ?؊MQ ?? ? f?#a }? ? ? ?? 0 ?+ ,'r &̅W 0? 2. u! 4 A l ?? ?( ̊C / T ??ԝ&安培; |&Hwmǰ放大器;?XOw'CC ?? 1? ?!`(〜V〜5 ?? 9SU1e〜?的Mib? o3R ?7 ?a wV >2u Z / ?PK ?????!? ? N???? _ rels / .rels ??( ? J?A ? a }7 H w ? ?w?̤̤ھ P ^ O֛ ; <? aYՠ;`G kxm ?PY [ gGΰino /< < 1 A
�M.�,%�ӗ��D>0�3i4�d����W��Ƃ��}J�!�J=��b>14��)��ͨe��̀��zw�@�8�d8x��-d���x�ub��D���J��U��sz� ��������ѥ�؊MQ�� �f#a�} ��������� ?��`0 ����+����,'r�&̅W�0�2.�u!�4�A�l���(��̊ ����C/T��ٍ�ԝ&|�H��w��m�ǰ&�XO�w'�C�C��� .��1!`��(~��V~5�����?9���S��U1e����~�M�ib����? o3R�7�a�wV�>2u�Z��/��PK!���N _rels/.rels �(����JA ���a�}7� "���H�w"����w̤ھ�� �P�^����O֛���;�<�aYՠ؛`G�kxm��PY�[��g Gΰino�/<���<�1��ⳆA


>f3 \ ȾT ?IS ? W? Yig @ X6_ ?] 7?~f ˉ? ?ao .b*lI r j) ,?l0 % b 6 i D _ , |u ?Z ^?t2yǯ;?!Y,?} { C /h> ;?????????????????????????????????????????????????????????????????? ; ? ] , Ř D ?P -igU q7?l K 7 /3 ߪ> :it 0b? ? ????环R {˞YPRFCzpl^^^ H\#;? VK ??]р0.4 H:U& 5 D !j (Zr; ` g )?f7% g}G { ?< b @ ? ?d(l ) ? @ ?? p'U׍??è?BE4 fo' ? 9 O? }K i?ƾ } F A X 0-< P ?? U I R {>有?一个R 10dώLt?? PK? ???? Y(+ 9 ??字/ document.xml中} nH的??? * L Z-G:!?/ Fپ EC iTbW'`%QI;?!?AR)及%Y&放大器; H6%Q第9>有?2p\öj^喾??վ^ y_c-%JS OC <??[X ^ ZPWՆb݆=&^Έ{쎸SW4 {4qc7 { [?oc? | :o 324 v G?9 } C? ?N > y?> ]G x? r​​ / 6Z nX
>"f3��\�ȾT��I S����������W����Y ig�@��X6_�]7~ f��ˉ�ao�.b*lI�r�j)�,l0�%��b� 6�i���D�_���, � ���|u�Z^t٢yǯ;!Y,}{�C��/h>��PK!-w�9�word/_rels/document.xml.rels �(����N�0��&��] ���,�Ř��D� P�-igU��q7 l��K��7��/3���ߪ >�:it��0b�”R� {˞��Y�P�R�FC�zpl�^^�^�H�\#;��v k��]р.4h:��U��5�D�!j�(Zr;�`�g�)f7%�g}G��{���<�b�@���d(l ��]��@?�p��"u׍e��'Be4f"o'��9��O�}K�iƾ���}����� F�A��X��0-<��P��U�����i�R�{��>����a�R����̂��d����ώL��t������PK!y�(�+�9word/document.xml�}�n�H����*�lZ�-g:/�f����پ���Ec��!�i�T�b��W��'`��%�Q�I�;AR")�&%Y&�H��6%Q��s?�9��>2ٝp\ö�j��^� K�u�վ^�y_c��-���%�jS�����?��O�C�����<�[X��^z��pw�Նb�݆=^��Έ{��쎸s�w4{4�qc��7����{[ oc�|�: o�324�v�G9��}C��N�� >y>���]G�x�r��؍�6Z�nX�





我尝试过:





What I have tried:

string wordHTML = System.IO.File.ReadAllText(path);


你需要能够正确解释文件格式。最简单的方法是使用可以为您读取文件的库



GitHub - xceedsoftware / DocX:快速且易于使用的.NET库,无需安装Word即可创建或修改Microsoft Word文件。 [ ^ ]
You need to be able to correctly interpret the file format. It's easiest to use a library that can read the files for you

GitHub - xceedsoftware/DocX: Fast and easy to use .NET library that creates or modifies Microsoft Word files without installing Word.[^]


这篇关于试图阅读MS word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆