简体   繁体   English

是否可以使用客户端脚本语言打开安装在客户端计算机上的应用程序

[英]Is it possible to open an application installed on client machine using client side scripting languages

I need a suggestion to clarify my thought.Now I am working on a Web application in ASP.NET MVC5 with Angularjs as the front end framework. 我需要一个建议来澄清我的想法。现在,我正在使用Angularjs作为前端框架的ASP.NET MVC5中的Web应用程序。 Is there any way to open client side application like MS Word/Outlook using any scripting languages like jquery,ajax,angularjs etc. 有什么方法可以使用任何脚本语言(如jquery,ajax,angularjs等)打开MS Word / Outlook之类的客户端应用程序。

Yes you can open any MS-WORD document using ActiveXObject . 是的,您可以使用ActiveXObject打开任何MS-WORD文档。
Following is the sample code to print file data on webpage. 以下是在网页上打印文件数据的示例代码。

var w=new ActiveXObject(‘Word.Application’);
if (w != null)

{

w.Visible = true; //set to false to stop the Word document from opening

obj=w.Documents.Open("C:\\blank.doc"); //this can be any location on your PC, not just C:

docText = obj.Content;

w.Selection.TypeText("Hello world!");

w.Documents.Save();

document.write(docText);//Print on webpage

For more information you can refer here. 有关更多信息,请参见此处。

In general, no, because that would be a huge security hole and lead to the spread of viruses and malware. 通常,不会,因为这将是一个巨大的安全漏洞,并导致病毒和恶意软件的传播。

In certain specific cases where you can control the user's computer already, you may be able to do it (eg Internet Explorer with trusted sites as Strom said). 在某些特定情况下,您已经可以控制用户的计算机,则可以执行此操作(例如,如Strom所说的具有受信任站点的Internet Explorer)。

But it's not really worth pursuing such options as they are being aggresively shut down by browser vendors all the time. 但这并不是真正值得追求的选择,因为浏览器供应商一直在不停地关闭它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 客户端脚本和服务器端脚本语言 - Client side scripting and Server side scripting languages 是否可以仅使用客户端语言来构建Web应用程序? - Is it possible to build a web application with only client side languages? 是否可以使用客户端脚本语言访问服务器 - Is it possible to access a server using Client side Scripting Language CSV 到 XML 使用客户端脚本 - CSV to XML Using Client-Side Scripting 使用客户端脚本的交互式地图 - Interactive map using client-side scripting DataTables服务器端脚本的客户端脚本 - Client side scripting for DataTables Server Side Scripting 是否可以仅使用客户端脚本以定义的列数显示结果数组? - Is it possible to display a results array in a defined number of columns using only client side scripting? 是否可以使用客户端脚本获取Twitter搜索API 1.1版的数据 - Is it possible to get the data for twitter search API version 1.1 using Client Side Scripting 是否可以使用 HTML、CSS 和 JavaScript 仅通过客户端脚本将文件上传到服务器? - Is it possible to upload a file into the server only with client side scripting using HTML,CSS and JavaScript? 是否有可能在执行JavaScript客户端脚本时检索网址的图标? - Is it possible to retrieve the favicon of a url doing javascript client side scripting?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM