博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
打开文件或者uri的方式--------进程启动文件和启动者启动文件
阅读量:7143 次
发布时间:2019-06-29

本文共 970 字,大约阅读时间需要 3 分钟。

The  Process class in  System.Diagnostics allows you to launch a new process.

For security reasons, the  Process class is not available in the
Metro profile, and you cannot start arbitrary processes. Instead,
you must use the  Windows.System.Launcher class to “launch” a
URI or file to which you have access, e.g.:
Launcher.LaunchUriAsync (new Uri ("http://albahari.com"));
var file = await KnownFolders.DocumentsLibrary.GetFileAsync ("foo.txt");
Launcher.LaunchFileAsync (file);
This opens the URI or file, using whatever program is associated
with the URI scheme or file extension. Your program must be
in the foreground for this to work.
The static  Process.Start method has a number of overloads; the simplest accepts a
simple filename with optional arguments:
Process.Start ("notepad.exe");
Process.Start ("notepad.exe", "e:\\file.txt");
You can also specify just a filename, and the registered program for its extension
will be launched:
Process.Start ("e:\\file.txt");

转载地址:http://yegrl.baihongyu.com/

你可能感兴趣的文章
安装淘宝镜像cnpm时出现问题及解决方案
查看>>
POJ-3255 Roadblocks---Dijkstra队列优化+次短路
查看>>
Sublime Text快捷键
查看>>
用Ant实现Java项目的自动构建和部署(转)
查看>>
[react] React 新手必须知道的 N 件事
查看>>
高精度阶乘计算(蓝桥杯)
查看>>
C++标准不允许拷贝构造函数传值参数
查看>>
异常 中断 实现
查看>>
001C#基本语法
查看>>
初识python: 集合
查看>>
noip rp++
查看>>
php mysql PDO使用
查看>>
python学习(七)--豆瓣爬取电影名,评分以及演员
查看>>
Android ImageView(scaleType属性)
查看>>
[AHOI2008]上学路线
查看>>
VS2013的项目转到VS2010需要修改的
查看>>
1.6.1 三角形
查看>>
CAS 集群部署
查看>>
HDU.2111 Saving HDU(贪心)
查看>>
sqlmap用户手册
查看>>