如何在网站上阅读单词文件 [英] How to read a word file in a website

查看:133
本文介绍了如何在网站上阅读单词文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提供一个选项来读取网站中的word文件.
我应该选择哪种语言?
请举个例子.

在此先感谢

I want to give option to read word file in a website.
which language should i choose for that?
Please give me some example.

Thanks in advance

推荐答案

C#很好.您可以在浏览器中发布文件并在服务器端阅读.您可以使用Office互操作:使用"COM"选项卡添加对项目的引用;程序集名称将类似于"Microsoft Word *.*对象库".

周围有很多代码示例,例如: http://zirmandli. wordpress.com/2007/07/04/read-word-doc-using-c/ [ http://msdn.microsoft.com/zh-cn/library/microsoft.office.interop.word%28v = office.14%29.aspx [ http://msdn.microsoft.com/en-us/library/ff597928.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/ff601860.aspx [ ^ ].

至于JavaScript,从理论上讲它是可行的,但我怀疑它是否有意义.但是,您可以找到一些项目,例如
http://www.kavoir. com/2009/01/using-javascript-to-open-excel-and-word-files-in-html.html [
C# is quite fine; you can post a file in the browser and read it on the server side. You can use Office interop: add a reference to your project using the COM tab; the assembly name will be like "Microsoft Word *.* Object Library".

There are many code samples around, like this one: http://zirmandli.wordpress.com/2007/07/04/read-word-doc-using-c/[^].

You will able to find some more if you Google.

Original documentation:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word%28v=office.14%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ff597928.aspx[^],
http://msdn.microsoft.com/en-us/library/ff601860.aspx[^].

As to JavaScript — its theoretically possible, but I doubt it even make sense. However, you can find some projects like
http://www.kavoir.com/2009/01/using-javascript-to-open-excel-and-word-files-in-html.html[^]; try to find some more, but I would not recommend it.

Also, I hope you realize that you cannot present a Word document on a Web page as is. This is proprietary format, not standardized with W3, so it does not really belongs on the Web. In real life though, there are a number of applications working with Word documents and even provide some editing capabilities (one typical example: job search sites). But in this case, everything is done in the form of HTML or XML; word documents are converted into HTML for presentation and editing and saved as Word by converting from HTML or XML.

—SA


这篇关于如何在网站上阅读单词文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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