Windows Phone Launcher class
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的更多相关文章
- Windows Phone 8.1又有什么新花样
今年微软新任CEO提出了“Mobile First and Cloud First”的发展战略,随着微软Mobile First战略的实行,开发者是时候重视Windows Phone了.你可能不相信, ...
- [深入浅出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# ...
- Windows Phone 8.1新特性 - 应用商店启动协议
Windows Phone 8.1 Preview SDK 发布也有几个月了,之前断断续续也写过几篇 Windows Phone 8.1 新特性的文章,今天给大家介绍一下应用商店启动协议相关的知识. ...
- Windows Phone 8.1 新特性 - 常用的启动器
本篇为大家介绍一下 Windows Phone 8.1 中部分常用启动器的实现方式.分别是 呼叫电话.发送短信.发送邮件.添加约会到日历.启动地图.地图路线显示.地图下载 和 地图更新. 1. 呼叫电 ...
- 【Win10 UWP】URI Scheme(一):Windows Store协议的解析和使用
协议是Windows Phone和Windows Store应用的一个重要特点,可以做到在不同应用之间进行互相呼起调用.小小协议,学问大着呢.我打算写几篇关于协议在UWP中使用的文章. 这一讲的主要对 ...
- Win10/UWP新特性系列—Launcher实现应用间的通信
UWP中,微软为Windows.System.Launcher启动器新增了很多的功能,以前只能启动App,打开指定扩展名文件,对uri协议的解析,以及当启动的应用没有安装时则会提示前往商店下载等. 如 ...
- Windows Phone 8.1商店启动协议
最近开发wp8.1已经两个月了,感觉坑不少,原来8时代的商店api多明了,微软不给封装就算了,至少你要在msdn上明显的地方标注下啊...................顺便在吐槽下bing,找了一个 ...
- Windows Store 开发总结——文件操作
1.读取Isolated Storage 每个Metro程序都有三个文件夹:Local,Roaming,Temp.每个文件夹的访问方法都是相同的. Local用于将数据存储在本地,这是程序特定的文件夹 ...
- 与众不同 windows phone (38) - 8.0 关联启动: 使用外部程序打开一个文件或URI, 关联指定的文件类型或协议
[源码下载] 与众不同 windows phone (38) - 8.0 关联启动: 使用外部程序打开一个文件或URI, 关联指定的文件类型或协议 作者:webabcd 介绍与众不同 windows ...
随机推荐
- 【codeforces 750B】New Year and North Pole
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Weblogic中可以使用的脚本
启动被管服务器的脚本 rm -rf ../servers/server5002/stage/* rm -rf ../servers/server5002/tmp/* sleep 20 USER_MEM ...
- head first c 笔记<3> 之做一件事并把它做好
1.标准输入.输出与重定向 scanf()和printf()分别为标准输入输出.默认的会从键盘得到数据,在显示器输出数据,是fscanf()和fprintf()函数的特例. 我们也能够用重定向来改变默 ...
- 配置SVN服务器
svn启动: 版本控制对于团队合作显得尤为重要,那么如何在iOS开发中进行版本控制呢?在今天的博客中将会介绍如何在MAC下配置SVN服务器,如何导入我们的工程,如何在Xcode中进行工程的checkO ...
- sql server中查询结果集顺序问题
因为优化器可能会选择并行处理,或者在多文件情况下不按“期待”顺序扫描数据,所以无法保证数据的顺序.唯一能确保顺序的只有order by. 并行处理的过程导致顺序不一致,单核上不存在并行,而双核,可能使 ...
- Linux核心设计依据(六)该块I/O一层
块设备是能随机存取装置固定大小的数据表设备.如硬盘:字符设备(如串口和键盘)它是按照字符流进入有序进行.不同之处在于是否足够的随机存取数据--这时候,你可以随心所欲地从一个位置跳到访问设备和位置.复杂 ...
- C# 从零开始写 SharpDx 应用 控制台创建 Sharpdx 窗口
原文:C# 从零开始写 SharpDx 应用 控制台创建 Sharpdx 窗口 版权声明:博客已迁移到 http://lindexi.gitee.io 欢迎访问.如果当前博客图片看不到,请到 http ...
- Docker简单的使用命令
Hello World 使用[docker run]命令在docker container中执行应用程序 <pre name="code" class="plain ...
- 《modern operating system》 chapter 5 Input and output 注意事项
Input / Output It should also provide an interface between the devices and the rest of the system th ...
- VAssist 使用技巧(函数声明定位,比VS的还要强大)
1. 有了VAX可以关掉C++导航栏,快捷键ALT+M,显示当前打开文档的所有符号,而且可以输入进行过滤 2. 查找文件,shift+alt+o (直接定位) 3. 查找符号shift+alt+s 4 ...