c#中的编码问题! [英] Problem in c# with encoding !

查看:58
本文介绍了c#中的编码问题!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我我应该安装什么,以便在C#中转换word文档或excel文档.我调用扩展名为.doc的文件,当将其放在列表框或文本框中时,会有不同的字符..


对于记事本文件没有问题,我只使用system.text.encoding.default ..

但是word和excel存在问题!

Can anyone tell me what should I install, to convert word document or excel document in c#...e.x I call a file with extension .doc...and when a put it in a listbox or textbox there are different character..


for notepad files there is no Problem, I just use system.text.encoding.default..

but word and excel there is a problem !

推荐答案

这是因为Word和Excel不是文本文件.计算中很少有文件是文本文件.实际上几乎没有.

如果要在应用程序中显示文件的内容,则您需要自己阅读实际的文件格式(并且创建该文件的每个应用程序都会有所不同,并且每个应用程序的每个版本通常也会有所不同) ,或使用创建它的实际程序来读取它,或使用转换器程序.
That is because Word and Excel are not text files. Very, very few files in computing are text files. Almost none, in fact.

If you want to display the content of a file in your application, then either you need to read the actual file format yourself (and it will be different for each application that created it, and normally different for each version of each application as well), or use the actual program that created it to read it, or use a converter program.


这篇关于c#中的编码问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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