打开文件或者uri的方式--------进程启动文件和启动者启动文件

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");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值