1、shell.openItem(fullPath)

var fullpath = path.join(processPath)+Math.random()+".png";

shell.showItemInFolder(fullPath)  //如果fullPath 是一个文件夹则打开,如果是一个文件,则打开其所在文件夹

https://electron.atom.io/docs/api/shell/

2\截图:

https://github.com/electron/electron/issues/8587

function takePicture(imagePath){
var imagePath = imgFile || path.join(processPath)+Math.random()+".png";
remote.getCurrentWebContents().capturePage({
x: 0,
y: 40,
width: 0, //保持原样,必须写
height: 0 //保持原样。必须写 这4个参数
},function(img){
remote.require('fs').writeFile(imagePaht,img.toPng());
shell.showItemInFolder(imagePath);
});
}

  

Eletron 打开文件夹,截图的更多相关文章

  1. VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答

    用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...

  2. 利用注册表在右键添加VS15的快捷方式打开文件夹

    1.简介 最近安装VS15 Preview 5,本版本可以打开"文件夹" 是否可以向Visual Studio Code一样在文件夹或文件右键菜单添加"Open with ...

  3. [VBA] 打开文件夹

    '显示打开文件夹对话框 With Application.FileDialog(msoFileDialogFolderPicker) .Show Then Exit Sub '未选择文件夹 strFo ...

  4. CentOS设置在同一窗口打开文件夹

    默认情况下,CentOS双击文件夹会打开一个新窗口.这对于习惯Windows的用户会感觉非常别扭.其实,如果用鼠标中键双击文件夹,就不会打开新窗口了.当然,也可以按照如下设置: 1.  打开任意一个文 ...

  5. c#: 打开文件夹并选中文件

    一.常规方法 给定一个文件路径,打开文件夹并定位到文件,通常所用shell命令为:explorer.exe /select,filepath. c#以进程启动之为: if (File.Exists(f ...

  6. C# winform打开文件夹并选中指定文件

    例如:打开“E:\Training”文件夹并选中“20131250.html”文件 System.Diagnostics.Process.Start("Explorer.exe", ...

  7. 在windows窗口下打开文件夹

    System.Diagnostics.Process.Start("Explorer.exe", @"C:\Users\gnt-wangt\Documents\Visua ...

  8. C#中FolderBrowserDialog类打开文件夹使用说明

    C#中FolderBrowserDialog类打开文件夹使用说明   作用:打开文件选择窗口获取文件夹路径.   导入的命名空间为: System.Windows.Forms; 属性:   Descr ...

  9. MFC 打开文件夹 调用其他程序 打开文件

    ShellExecute(NULL,TEXT("OPEN"),要打开的文件的路径,NULL,NULL,SW_SHOWNORMAL); ShellExecute(NULL, &quo ...

随机推荐

  1. Missing Number @leetcode

    Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...

  2. [UE4]C++ getter and setter

    问:以前面向对象没学好.... 最近老是在想,既然要设为private为什么还要写个setter来改变它的值呢? 为什么不直接把它直接设成public倒省事? 呵呵,谢啦 答:用setter来改变数据 ...

  3. [UE4]C++代码操作SplineMesh

    转自:http://aigo.iteye.com/blog/2279503 void ARaceSpline::OnConstruction(const FTransform& Transfo ...

  4. VS Code 基本介绍 和 快捷键

    简介 VSCode是微软推出的一款轻量编辑器,采取了和VS相同的UI界面,搭配合适的插件可以大幅提升前端开发的效率. 布局:左侧是用于展示所要编辑的所有文件和文件夹的文件管理器,依次是:资源管理器,搜 ...

  5. osx 安装redis

    brew install redis 想关文章 http://www.tuicool.com/articles/nM73Enr http://www.iteye.com/topic/1124400

  6. g++多文件编译

    头文件:A.h void test(); 源文件:A.cpp #include <iostream> #include<thread> #include<chrono&g ...

  7. UVA-673-栈-水题

    题意: 检测括号是否匹配,注意有空格 #include<stdio.h> #include<iostream> #include <strstream> #incl ...

  8. python urlretrieve 下载图片

    python 3中urlretrieve方法直接将远程数据下载到本地.为什么不行? 55 import re import urllib.request def getHtml(url): page ...

  9. 将文本转换为json的工具类

      JSONObject jsonObj  = JSONObject.fromObject("文本"); 参考:https://www.cnblogs.com/joahyau/p/ ...

  10. PHP依赖注入(DI)和控制反转(IoC)详解

    这篇文章主要介绍了PHP依赖注入(DI)和控制反转(IoC)的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 首先依赖注入和控制反转说的是同一个东西,是一种设计模式,这种设计模式用来减少程 ...