gpt4 book ai didi

c# - LaunchUriAsync() 不会启动 Windows 应用商店应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 13:46:42 25 4
gpt4 key购买 nike

我正在尝试通过 LaunchUriAsync() 在 OnShareTargetActivated() 方法上调用我的应用程序,但它不起作用。

我在 appmanifest 中有一个名为“myapp”的协议(protocol)。当我将“myapp://test”放在文件资源管理器上时,我的应用程序启动了,但是当我这样做时:

protected async override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
Uri uri = new Uri("myapp://test");
await Windows.System.Launcher.LaunchUriAsync(uri);
}

当用户在“共享”选项的 Charm Bar 上单击我的应用程序时,会发生这种情况。但该应用程序从未启动。

最佳答案

共享应用示例 ( http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782 )

你应该检查你分享的内容的格式,metro 只接受某种类型的内容分享,分享格式是 Text,uri,Bitmap,storageitems,Html

分享目标代码和图片(http://blogs.msdn.com/b/going_metro/archive/2012/05/03/integrating-with-windows-8-share-charm-part-1-receiving-data.aspx)

如果你觉得有用,请采纳为答案

关于c# - LaunchUriAsync() 不会启动 Windows 应用商店应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15114027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com