[英]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
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.