我可以使用 URL 打开 Windows 8 应用程序吗? [英] Can I open a Windows 8 application with a URL?

查看:65
本文介绍了我可以使用 URL 打开 Windows 8 应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个具有共享会话功能的应用程序.例如私人应用程序到应用程序聊天会话...

I am creating an app with a shared session capability. For example a private app-to-app chat session...

我会启动应用程序并创建一个聊天室",然后通过电子邮件与某人分享".我想要做的是创建一个 URL,当它被点击时它会在你的计算机上打开应用程序......如果我邀请你进入我的聊天室".

I would start the app and create a "chat room" then "share" with someone via email. What I would like to do is create a URL that when it is clicked on it opens the app on your computer... if I am inviting you to my "chat room".

我已经在网上四处看了看,但在任何地方都没有发现这种行为.

I have poked around on the web but don't see this behavior called out anywhere.

推荐答案

您可以轻松地做到这一点 &只需在 Metro 应用程序中添加一个特殊部分到您的清单,并确保您在激活处理程序中处理正确的激活类型.

You can do this easily & simply with a metro application by adding a special section to your manifest, and making sure you handle the correct activation type in your activation handler.

您可以使用 VS Editor for the manfiest 轻松添加到清单中:

You can easily add to the manifest by using the VS Editor for the manfiest:

  • 在解决方案资源管理器中双击打开清单
  • 选择声明"标签
  • 在可用声明"下选择协议,然后点击添加
  • 将名称字段设置为您想要的协议.例如myawesomeapp"(这会给你像 myawesomeapp://foo/bar/baz 这样的网址)
  • Open the manifest by double clicking on it on solution explorer
  • Select "Declarations" tab
  • Under "Available declarations" select protocol, and then click add
  • Set the name field to the protocol you want. e.g. "myawesomeapp" (this will give you urls like myawesomeapp://foo/bar/baz)

要处理此协议,您需要查找激活类型协议".这是在您的激活处理程序中,以及种类"属性上.有关 MSDN 的完整详细信息此处(prog. lang. switch 位于右上角)JavaScript &C#/C++/VB.

To handle this protocol you need to look for the activation kind "Protocol". This is in your activation handler, and on the "Kind" property. Full details on MSDN here (prog. lang. switch is in the top right) for both JavaScript & C#/C++/VB.

这篇关于我可以使用 URL 打开 Windows 8 应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆