UWP基础教程 - 调起应用的几种方法

1. 使用UWP的Launcher API

var uri = new Uri("protocolname:");
bool success = await Windows.System.Launcher.LaunchUriAsync(uri);

参考:Calling Windows 10 APIs From a Desktop Application

2.使用PackageManager,也是UWP的API

var manager = new PackageManager();
var p = manager.FindPackagesForUser("", PackageFamilyName);
var ls = await p.ToList()[0].GetAppListEntriesAsync();
foreach (var item in ls)
{
    await item.LaunchAsync();
}

3.使用Process调用protocolname

Process.Start(new ProcessStartInfo("protocolname:"));

4.使用命令行

>start bingnews:
>start myapplication:protocol-parameter
>start myapplication://single-player/level3?godmode=1&ammo=200

参考:自动启动 Windows 10 UWP 应用

Comment