在我的应用程序中,我存储了一些文件,然后使用以下代码打开它们:
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 BUT只针对无法识别的文件:
// 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);
有办法做到这一点吗?!