Starts the default app associated with the specified file or URI.

Launch a file contained in the app package

async void DefaultLaunch()
{
// Path to the file in the app package to launch
string imageFile = @"images\test.png"; var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile); if (file != null)
{
// Launch the retrieved file
var success = await Windows.System.Launcher.LaunchFileAsync(file); if (success)
{
// File launched
}
else
{
// File launch failed
}
}
else
{
// Could not find file
}
}

Launch a URI

// The URI to launch
string uriToLaunch = @"http://www.bing.com"; // Create a Uri object from a URI string
var uri = new Uri(uriToLaunch); // Launch the URI
async void DefaultLaunch()
{
// Launch the URI
var success = await Windows.System.Launcher.LaunchUriAsync(uri); if (success)
{
// URI launched
}
else
{
// URI launch failed
}
}

Windows Phone Launcher class的更多相关文章

  1. Windows Phone 8.1又有什么新花样

    今年微软新任CEO提出了“Mobile First and Cloud First”的发展战略,随着微软Mobile First战略的实行,开发者是时候重视Windows Phone了.你可能不相信, ...

  2. [深入浅出WP8.1(Runtime)]Windows Phone 8.1和Silverlight 8.1的区别

    1.2.2 Windows Phone 8.1应用程序模型 Windows Phone 8.1支持多种开发语言来开发应用程序,包括C#.VB.JavaScript和C++,那么本书的代码主要是采用C# ...

  3. Windows Phone 8.1新特性 - 应用商店启动协议

    Windows Phone 8.1 Preview SDK 发布也有几个月了,之前断断续续也写过几篇 Windows Phone 8.1 新特性的文章,今天给大家介绍一下应用商店启动协议相关的知识. ...

  4. Windows Phone 8.1 新特性 - 常用的启动器

    本篇为大家介绍一下 Windows Phone 8.1 中部分常用启动器的实现方式.分别是 呼叫电话.发送短信.发送邮件.添加约会到日历.启动地图.地图路线显示.地图下载 和 地图更新. 1. 呼叫电 ...

  5. 【Win10 UWP】URI Scheme(一):Windows Store协议的解析和使用

    协议是Windows Phone和Windows Store应用的一个重要特点,可以做到在不同应用之间进行互相呼起调用.小小协议,学问大着呢.我打算写几篇关于协议在UWP中使用的文章. 这一讲的主要对 ...

  6. Win10/UWP新特性系列—Launcher实现应用间的通信

    UWP中,微软为Windows.System.Launcher启动器新增了很多的功能,以前只能启动App,打开指定扩展名文件,对uri协议的解析,以及当启动的应用没有安装时则会提示前往商店下载等. 如 ...

  7. Windows Phone 8.1商店启动协议

    最近开发wp8.1已经两个月了,感觉坑不少,原来8时代的商店api多明了,微软不给封装就算了,至少你要在msdn上明显的地方标注下啊...................顺便在吐槽下bing,找了一个 ...

  8. Windows Store 开发总结——文件操作

    1.读取Isolated Storage 每个Metro程序都有三个文件夹:Local,Roaming,Temp.每个文件夹的访问方法都是相同的. Local用于将数据存储在本地,这是程序特定的文件夹 ...

  9. 与众不同 windows phone (38) - 8.0 关联启动: 使用外部程序打开一个文件或URI, 关联指定的文件类型或协议

    [源码下载] 与众不同 windows phone (38) - 8.0 关联启动: 使用外部程序打开一个文件或URI, 关联指定的文件类型或协议 作者:webabcd 介绍与众不同 windows ...

随机推荐

  1. php课程 6-21 HTML标签相关函数

    php课程 6-21 HTML标签相关函数 一.总结 一句话总结:1.存入数据库的html标签代码:$info=addslashes(htmlspecialchars($_POST['info'])) ...

  2. TensorFlow 学习(十四)—— contrib

    1. tensorflow.contrib.layers tf.contrib.layers.xavier_initializer():一种经典的权值矩阵的初始化方式:

  3. 【BZOJ 1012】 [JSOI2008]最大数maxnumber(线段树做法)

    [题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1012 [题意] [题解] 预开一个20W长度的线段树; 这里a[1..20W]={0} ...

  4. 【u127】台阶问题

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 有N级的台阶,你一开始在底部,每次可以向上迈最多K级台阶(最少1级),问到达第N级台阶有多少种不同方式 ...

  5. 【33.33%】【codeforces 586D】Phillip and Trains

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  6. Lettcode_104_Maximum Depth of Binary Tree

    本文研究的总结,欢迎转载,但请注明出处:http://blog.csdn.net/pistolove/article/details/41964475 Maximum Depth of Binary ...

  7. document.addEventListener的使用介绍

    document.addEventListener("事件名称", 函数, false); function 函数名(event){ // 方法执行 } addEventListe ...

  8. java基础篇---文件上传(组件)

    转载自:http://www.cnblogs.com/oumyye/p/4234969.html 文件上传几乎是所有网站都具有的功能,用户可以将文件上传到服务器的指定文件夹中,也可以保存在数据库中,本 ...

  9. net平台的rabbitmq

    net平台的rabbitmq使用封装 前言 RabbitMq大家再熟悉不过,这篇文章主要整对rabbitmq学习后封装RabbitMQ.Client的一个分享.文章最后,我会把封装组件和demo奉上. ...

  10. C# 与.NET2.0 中类型Type的GetMethod方法

    C#中类型Type有个GetMethod方法,调用该方法可获取指定方法名的方法信息实例. 使用时,其参数一般为2个,一个是方法名称字符串(可设置条件忽略大小写),另外一个参数为搜索方法的条件枚举. 该 ...