C# 如何从windows应用商店应用程序启动桌面应用程序?
请告诉我如何使用c#从Windows应用商店应用程序启动桌面应用程序或.exe文件C# 如何从windows应用商店应用程序启动桌面应用程序?,c#,windows,windows-store-apps,microsoft-metro,windows-8.1,C#,Windows,Windows Store Apps,Microsoft Metro,Windows 8.1,请告诉我如何使用c#从Windows应用商店应用程序启动桌面应用程序或.exe文件 任何帮助都将不胜感激。提前谢谢 如评论中所述,由于沙盒环境,您无法直接从Windows应用商店应用程序启动可执行文件。但是,您可以使用API启动与文件关联的可执行文件。因此,可以在自定义文件扩展名和要启动的应用程序之间创建文件关联。然后,只需使用LauncherAPI打开一个具有自定义文件扩展名的文件 public async void DefaultLaunch() { // Path to the fi
任何帮助都将不胜感激。提前谢谢 如评论中所述,由于沙盒环境,您无法直接从Windows应用商店应用程序启动可执行文件。但是,您可以使用API启动与文件关联的可执行文件。因此,可以在自定义文件扩展名和要启动的应用程序之间创建文件关联。然后,只需使用LauncherAPI打开一个具有自定义文件扩展名的文件
public async void DefaultLaunch()
{
// Path to the file in the app package to launch
string imageFile = @"images\test.png";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
if (file != null)
{
// Launch the retrieved file
var success = await Windows.System.Launcher.LaunchFileAsync(file);
if (success)
{
// File launched
}
else
{
// File launch failed
}
}
else
{
// Could not find file
}
}
如何
过程。开始?这不是不可能的。问题看起来与@Herdo重复此命名空间在Windows应用商店中不可用Apps@feeeper你的意思是无法从Windows应用商店应用程序调用外部程序?@WaqasAhmedKhan是的。因为windows应用商店应用程序在沙盒环境中运行。