Windows 8 应用程序中支持的 URI 方案 [英] URI schemes supported in Windows 8 apps

查看:21
本文介绍了Windows 8 应用程序中支持的 URI 方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 8 应用程序支持哪些 URI 方案?我看到了对 ms-appx: 和 ms-appdata:<的引用/a> 和一些罕见的 ms-resource: 但我找不到任何可以作为方案列表的文件(虽然我认为我过去看过一个).我想知道 URL.createObjectURL 是否返回其他一些方案,但我看不到 XAML 应用程序的版本.http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx.WinRT 中是否支持任何其他 URI 方案?

解决方案

我相信 Metro js 方案. 也适用于 xaml.

此处列出了一些用于 xaml 应用程序的内容:如何加载文件资源(对于 XAML 应用程序)

ms-resource: 适用于 xaml 应用程序在此处列出:ResourceLoader.GetStringForReference

地铁应用程序中可用的 URI:

一般形式

://<域名>/;

Http

http://www.contoso.com/images/logo.png

应用包

ms-appx:ms-appx:///default.htmlms-appx-web:

<块引用>

通过这个方案引用的内容是从本地包加载的,但在网络上下文的能力和限制下运行.

文件系统

不能直接使用.要使用,获取一个 IStorageItem 然后使用 URL.createObjectURL

file://

应用数据

ms-appdata://

资源

ms-resource://

依赖包

<域名>:

WebSockets

ws: 表示未加密,wss: 表示加密.像这样使用:

webSocket = new MessageWebSocket();等待 webSocket.ConnectAsync("wss://www.example.com");

What are the URI schemes supported in Windows 8 apps? I have seen references to ms-appx: and ms-appdata: and some rare mentions of ms-resource: but I could not find any document that would be a list of the schemes (although I thought I have seen one in the past). I am wondering if URL.createObjectURL returns some other schemes, but I can't see a version of it for XAML apps. http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx. Are there any other URI schemes supported in WinRT?

解决方案

I believe the Metro js schemes. apply to xaml as well.

Some of those for xaml apps are listed here: How to Load File Resources (for XAML apps)

ms-resource: for xaml apps is listed here: ResourceLoader.GetStringForReference

URIs available in metro applications:

General form

<scheme>://<domain name>/<path>

Http

http://www.contoso.com/images/logo.png

App Package

ms-appx:
ms-appx:///default.html
ms-appx-web:

Content referenced via this scheme is loaded from the local package, but runs with the abilities and restrictions of the web context.

File System

Can't be used directly. To use, obtain an IStorageItem and then use URL.createObjectURL

file://

App Data

ms-appdata://

Resources

ms-resource://

Dependent Packages

<domain name>:

URIs for WebSockets

ws: for unencrypted and wss: for encrypted. Used like this:

webSocket = new MessageWebSocket();
await webSocket.ConnectAsync("wss://www.example.com");

这篇关于Windows 8 应用程序中支持的 URI 方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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