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 ...
随机推荐
- python3 numpy API练习代码
# -*- coding: utf-8 -*- import numpy as np; a=np.array([1,2,3,4,5,6]); print("数组是:",a) #数组 ...
- 【z03】Mayan游戏
[问题描述] Mayan puzzle是最近流行起来的一个游戏.游戏界面是一个 7 行5 列的棋盘,上面堆放 着一些方块,方块不能悬空堆放,即方块必须放在最下面一行,或者放在其他方块之上.游 戏通关是 ...
- UIlabel文字大小自适应label宽度变大变小
label.adjustsFontSizeToFitWidth = YES; //默认no
- 【BZOJ 1034】[ZJOI2008]泡泡堂BNB
[题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1034 [题意] [题解] 如果己方最小的大于对方最小的(严格大于) 或己方最大的大于对 ...
- Java反射xml数据类
我们做自己的自动化测试.遇到使用xml存储数据,然而,这些数据可以被封装成一个类.将数据传递.通过下面的实际例子,展示给大家.请欣赏. 第一步:xml数据存储将被使用 第二步:读取xml文件的方法 第 ...
- httpclient htmlunit下载单个文件
httpclient public class Download { public static void main(String[] args) throws ClientProtocolExcep ...
- hadoop中国字、词频统计和排序
例如需求,下面: 有被看作图输入文件中. 代表ip地址,之后的偶数列代表搜索词.数字(奇数列)代表搜索次数.使用"\t"分隔.如今须要对搜索词进行分词并统计词频,此处不考虑搜索次数 ...
- js精确判断数据类型为何用Object.prototype.toString.call()而不是Object.prototype.toString()
有何区别,为何一定要通过call. 我们知道call是用来改变函数作用域的,Object.prototype.toString.call在这儿也是用来改变作用域的. Object.prototype. ...
- Troubleshooting routing topology based on a reference topology
In one embodiment, a computing device (e.g., border router or network management server) transmits a ...
- 正割函数(sec)
1. 定义 正割与余弦互为倒数,余割与正弦互为倒数.即: ⎧⎩⎨⎪⎪⎪⎪secθ=1cosθcscθ=1sinθ 也即在几何上,设 △ABC,∠C=90°,AC=b,BC=a,AB=c, 正割函数:s ...