• 1.创建通过协议启动的项目 AppDemo
  • 2.在项目的Package.appxmanifest 文件里 Extensions 目录下
      <Extensions>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="uridemo">
<uap:Logo>Assets\StoreLogo.png</uap:Logo>
<uap:DisplayName>AppDemo</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
</Extensions>
  • 3.在App.xaml.cs里
        protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
// Window management
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
Window.Current.Content = rootFrame;
}
switch (args.Kind)
{
case ActivationKind.VoiceCommand:
{
break;
}
case ActivationKind.Protocol:
{
// Code specific to launch for results
var command = args as ProtocolActivatedEventArgs; if (command.Uri.ToString().StartsWith("uridemo://"))
{
// Open the page that we created to handle activation for results.
rootFrame.Navigate(typeof(MainPage), command); }
else
{
//.....
}
break;
}
} // Ensure the current window is active.
Window.Current.Activate();
}
  • 4.在创建一个要启动的项目AppClient
        private async void button_Click(object sender, RoutedEventArgs e)
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("uridemo://appdata"));
}
  • 5.部署完成,启动AppClient

最新文章

  1. JAVA GC 简单总结
  2. 给tabBar设置图片和字体颜色的几种方法
  3. [QualityCenter]设置工作流脚本-设置不同字段值关联不同列表
  4. 优化后的二次测试Miller_Rabin素性测试算法
  5. 国际制造执行系统(MES)应用与发展
  6. CentOS 搭建LNMP服务器和LAMP服务器
  7. [Oracle]Oracle学习小结(1)
  8. Java网络编程(TCP协议-服务端和客户端交互)
  9. Verilog HDL中阻塞语句和非阻塞语句的区别
  10. 关于虚拟机装kali-linux的联网问题
  11. 【Java基础】对象的具体创建过程
  12. Java学习笔记之I/O流(读取压缩文件以及压缩文件)
  13. POP音原因
  14. OC字符串的使用(一)
  15. 用Qemu运行/调试arm linux【转】
  16. gin框架使用注意事项
  17. 合肥.NET技术社区首次线下聚会全程回顾【多图】
  18. Python Learning: 03
  19. 动态规划-poj1949
  20. 0703-spring cloud config-git配置属性加解密之对称加密

热门文章

  1. eclipse IED 创建springboot项目教程
  2. 将项目上传到Github之使用git命令上传
  3. Bootstrap 表单控件一(单行输入框input,下拉选择框select ,文本域textarea)
  4. SIGPROF和SIGALRM使用总结
  5. DJANGO里让用户自助修改邮箱地址
  6. 【ACM】bailian_2703_骑车与走路_201307301543
  7. 6款程序猿不得不爱的bootstrap模板
  8. linux下安装rar解压包
  9. Java基础:异常捕获顺序
  10. Java内存管理及垃圾回收总结