【发布时间】:2017-08-22 17:24:23
【问题描述】:
如何使用 FileSavePicker 从 appdata:/assets/images 复制 *.png。我找到了这个例子File Save Picker - Save Edited Image (C# Metro app),但它不起作用。
我有这个代码:
private async void OpenButton_Click(object sender, RoutedEventArgs e)
{
string path = @"\Assets\Logo.png";
StorageFolder folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await folder.GetFileAsync(path);
// Show the picker
FileSavePicker savePicker = new FileSavePicker();
// Set the file that will be saved
savePicker.SuggestedSaveFile = file;
savePicker.SuggestedFileName = "Logo";
savePicker.FileTypeChoices.Add("PNG", new List<string>() { ".png" });
savePicker.PickSaveFileAndContinue();
}
但他将文件保存为 0 字节
【问题讨论】:
-
是复制还是保存?
-
我需要将应用程序保存到您的手机
标签: c# windows-phone-8 windows-phone