I want to code C Sharp to copy an image from the first folder to the second volume, and if the image already exists in the second volume is replaced
I tried to use the function File.Copy () with the Delete () function , but shows a error in the program when the deletions because the image will be displayed in the pictuerBox refuses to delete the image and replace it
Pruthviraj MohitePosted Jan 8, 2014, 12:24 AM
lamasat lamasatPosted Jan 7, 2014, 1:46 PM
lamasat lamasatPosted Jan 7, 2014, 1:44 PM
Pruthviraj MohitePosted Jan 7, 2014, 1:17 AM
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("myFile.png");
var folder = await ApplicationData.Current.LocalFolder.GetFolderAsync("myFolder");
await file.CopyAsync(folder);
Move Image File
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("myFile.png");
var folder = await ApplicationData.Current.LocalFolder.GetFolderAsync("myFolder");
await file.MoveAsync(folder);
In the Move Code try for delete() for existing image
Delete Image File
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("myFile.png");
await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
Try.. If not worked let me know.. I will Help You...