1.打开本地文件或者网页链接 // 打开系统本地文件 const {shell} = require('electron'); // Open a local file in the default app var path1 = "d:\ProjectsSpace\ElectronProjects\ElectronTest2\app\html\config\record.txt"; shell.openItem(path1); //打开网页链接 // Open a URL in th
IE浏览器打开C盘,测试可用. 如果浏览器报错提示:ActiveXObject is not defined Internet 选项 -> 安全 - >安全级别,调低级别 function openFileIIs(){ try{ var obj=new ActiveXObject("wscript.shell"); if(obj){ obj.Run("c:/", 1, false ); //obj.run("osk");/*打开屏幕键
原网址:http://blog.csdn.net/cofesun/article/details/7904887javascript有个特殊的对象ActiveXObject,通过它可以访问windows的本地文件系统和应用程序 <script> function openFileIIs(filename){ try{ var obj=new ActiveXObject("wscript.shell"); if(obj){ obj.Run("\""