使用ShellExecute打开文件夹并选中文件
原文链接: http://futurecode.is-programmer.com/posts/24780.html
假设在C:\目录下存在文件a.txt。
打开这个目录是ShellExecute的常用功能,代码如下:
ShellExecute(NULL, "open", "explorer.exe", "C:\\", NULL, SW_SHOWNORMAL);
要在此基础上增加“选中文件”功能(这是很多下载工具和格式转换工具提供的常用功能),只需要将上面目录的名称换成文件的名称,并在前面加上"/select,":
ShellExecute(NULL, "open", "explorer.exe", "/select,C:\\a.txt", NULL, SW_SHOWNORMAL);
使用ShellExecute打开文件夹并选中文件的更多相关文章
- c#: 打开文件夹并选中文件
一.常规方法 给定一个文件路径,打开文件夹并定位到文件,通常所用shell命令为:explorer.exe /select,filepath. c#以进程启动之为: if (File.Exists(f ...
- VC在windows中打开文件夹并选中文件
网上一位前辈高人的一段精髓代码让我眼前一亮…… ShellExecute(NULL, "open", "explorer.exe", "/select ...
- js打开所在文件夹并选中文件
该方法只支持IE. var wsh = new ActiveXObject("WSCript.shell"); var src = "/select," + ...
- [转]C#中调用资源管理器(Explorer.exe)打开指定文件夹 + 并选中指定文件 + 调用(系统默认的播放类)软件(如WMP)打开(播放歌曲等)文件
原文:http://www.crifan.com/csharp_call_explorer_to_open_destinate_folder_and_select_specific_file/ C#中 ...
- C# winform打开文件夹并选中指定文件
例如:打开“E:\Training”文件夹并选中“20131250.html”文件 System.Diagnostics.Process.Start("Explorer.exe", ...
- 使用ShellExecute打开目标文件所在文件夹并选中目标文件
转载:http://blog.csdn.net/chenlycly/article/details/7366364 转载:http://bbs.csdn.net/topics/50440550 She ...
- C#项目打开/保存文件夹/指定类型文件,获取路径
C#项目打开/保存文件夹/指定类型文件,获取路径 转:http://q1q2q363.xiaoxiang.blog.163.com/blog/static/1106963682011722424325 ...
- 使用C#选择文件夹、打开文件夹、选择文件
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 重新想象 Windows 8 Store Apps (25) - 选取器: 文件选取窗口, 文件夹选取窗口, 文件保存窗口
原文:重新想象 Windows 8 Store Apps (25) - 选取器: 文件选取窗口, 文件夹选取窗口, 文件保存窗口 [源码下载] 重新想象 Windows 8 Store Apps (2 ...
随机推荐
- 使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any ex ...
- Nginx做正向代理并缓存文件
和前面一篇用Nginx做反向代理并缓存静态文件 差别仅在于这是内部机器用来通过Nginx上外网的方式. 其他配置差不多,仅在下面有点区别 server { listen 83; location / ...
- RT/Metro商店应用如何调用SQLite数据库
RT/Metro商店应用如何调用SQLite数据库 使用前,要安装:SQLite for Windows Runtime (Windows 8.1)(一个VS插件).还有Visual C++ Runt ...
- Semaphore的使用
Semaphore也是一个线程同步的辅助类,可以维护当前访问自身的线程个数,并提供了同步机制.使用Semaphore可以控制同时访问资源的线程个数,例如,实现一个文件允许的并发访问数. Semapho ...
- SpringMVC+SPring+Maven+Mybaits+Shiro+Mybaits基础开发项目
开源项目资料库:https://gitee.com/VCS/seezoon-framework-all Seezoon项目介绍 基于spring,mybatis,shiro面向接口开发的的一套后台管理 ...
- Python学习笔记八:ORM框架SQLAlchemy
一:SQLAlchemy使用 1:实体类的创建 ORM中的实体类与一般的Python类不同,在其中,使用 __tablename__=""指明该类与数据库中某个表相对应,然后定义一 ...
- Linux日志文件utmp、wtmp、lastlog、messages
1.有关当前登录用户的信息记录在文件utmp中:==who命令 2.登录进入和退出纪录在文件wtmp中:==w命令 3.最后一次登录文件可以用lastlog命令察看: 4.messag ...
- 利用Percona monitoring for zabbix监控MySQL
系统要求 被监控的主机及mysql监控账号,zabbix agent 2.0或以上(最好与zabbix-server版本相同),php, php-mysql(php版本没有限制,经测试5.3是可以的. ...
- 系统安装-007 CentOS7yum源添加、删除及其yum优化(转)
一.配置阿里云源为主源mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bakwget -O /et ...
- where常用运算符
mysql查询的五种子句:where(条件查询).having(筛选).group by(分组).order by(排序).limit(限制结果数) where常用运算符:比较运算符> , &l ...