void DeleteFiles(Storage storage, string directoryPath) { foreach (var filename in storage.GetFileNames(directoryPath + "*")) { storage.DeleteFile(directoryPath + filename); } }
public IsolatedStorageDirectory_Tests() { storage = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForAssembly(); foreach (var filename in storage.GetFileNames("*")) { storage.DeleteFile(filename); } }
protected virtual void RemoveIsolatedStorage(string fileName) { using (System.IO.IsolatedStorage.IsolatedStorageFile l_Storage = GetStorage()) { l_Storage.DeleteFile(fileName); l_Storage.Close(); } }
public IsolatedStorageDirectory_Tests() { storage = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForAssembly(); foreach (var filename in storage.GetFileNames()) { storage.DeleteFile(filename); } }
public void DeleteIndex() { System.IO.IsolatedStorage.IsolatedStorageFile local = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication(); if (local.FileExists("IndicesFolder\\Index.txt")) { local.DeleteFile("IndicesFolder\\Index.txt"); } }
void PhotoTask_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null) { System.Windows.Media.Imaging.WriteableBitmap bmp = Microsoft.Phone.PictureDecoder.DecodeJpeg(e.ChosenPhoto); System.IO.IsolatedStorage.IsolatedStorageFile isf = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication(); if (isf.FileExists("back_temp.jpg")) { isf.DeleteFile("back_temp.jpg"); } System.IO.IsolatedStorage.IsolatedStorageFileStream PhotoStream = isf.CreateFile("back_temp.jpg"); System.Windows.Media.Imaging.Extensions.SaveJpeg(bmp, PhotoStream, 1024, 768, 0, 100); //这里设置保存后图片的大小、品质 PhotoStream.Close(); //写入完毕,关闭文件流 } }
private void Bcakground_Click(object sender, RoutedEventArgs e) { if ((bool)checkBoxSetting.IsChecked) { takePhote(); NavigationService.GoBack(); } else { System.IO.IsolatedStorage.IsolatedStorageFile isf = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication(); if (isf.FileExists("back_temp.jpg")) { isf.DeleteFile("back_temp.jpg"); } } }
public void Delete() { storage.DeleteFile(systemFilename); }