我是这样编码的,
但是,这仅支持已存在的文件。
我想要“新建文件对话框”,这意味着即使我输入不存在的文件名它也可以获得路径。
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.ComputerFolder;
openPicker.FileTypeFilter.Add(".csv");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
}
else
{
}
最佳答案
我认为您正在寻找 FileSavePicker而不是FileOpenPicker .
语法非常相似:
StorageFile file = await savePicker.PickSaveFileAsync();
关于c# - 如何使用FileOpenPicker打开 'New File Dialog'? (UWP),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48087952/