【发布时间】:2013-05-20 13:32:02
【问题描述】:
我正在尝试开发一个应用程序,该应用程序使用启动器类从 Metro 应用程序启动常规 .exe 应用程序。 MSDN 提供了一个示例here,stackoverflow 示例是here
问题是我的地铁即使文件在那里也会出现“找不到文件”的错误。我也尝试将文件放在其他驱动器上,但问题仍然存在
这是我的代码示例
// Path to the file in the app package to launch
string imageFile = @"E:\App.exe";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
/* 上述行中的错误。它说找不到文件 文件名、目录名或卷标语法不正确。 (HRESULT 异常:0x8007007B)*/
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
}
【问题讨论】:
标签: c#