在我的应用程序中,我存储了一些文件,并使用以下代码打开它们:
StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile file = await localFolder.GetFileAsync(objectName);
if (file != null)
{
// Launch the retrieved file
bool success = await Windows.System.Launcher.LaunchFileAsync(file);
}
else
{
messageBox("File not found", "Attention");
}
它适用于 PDF、XML、DOC 等文件,但它根本不适用于具有特定扩展名的文件,例如 XML……我想打开 DisplayApplicationPicker 但仅用于无法识别的文件:
// Set the option to show the picker
var options = new Windows.System.LauncherOptions();
options.DisplayApplicationPicker = false;
// Launch the retrieved file
bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
有没有办法做到这一点?!