當前位置: 首頁>>代碼示例>>C#>>正文


C# IsolatedStorageFile.DeleteFile方法代碼示例

本文整理匯總了C#中System.IO.IsolatedStorage.IsolatedStorageFile.DeleteFile方法的典型用法代碼示例。如果您正苦於以下問題:C# IsolatedStorageFile.DeleteFile方法的具體用法?C# IsolatedStorageFile.DeleteFile怎麽用?C# IsolatedStorageFile.DeleteFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IO.IsolatedStorage.IsolatedStorageFile的用法示例。


在下文中一共展示了IsolatedStorageFile.DeleteFile方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SafeDeleteFile

 private static void SafeDeleteFile(IsolatedStorageFile store)
 {
     try
     {
         store.DeleteFile(Filename);
     }
     catch (Exception ex)
     {
     }
 }
開發者ID:aritzcovan,項目名稱:ezweather,代碼行數:10,代碼來源:LittleWatson.cs

示例2: SafeDeleteFile

 private static void SafeDeleteFile(IsolatedStorageFile store)
 {
     try
     {
         store.DeleteFile(FILENAME);
     }
     catch (Exception)
     {
     }
 }
開發者ID:fabmoll,項目名稱:SimpleTodo,代碼行數:10,代碼來源:LittleWatson.cs

示例3: InnerClear

 private void InnerClear(IsolatedStorageFile iso, string path) {
     var fs = iso.GetFileNames(string.Format("{0}/*", path));
     foreach (var f in fs) {
         iso.DeleteFile(Path.Combine(path, f));
     }
     var ds = iso.GetDirectoryNames(string.Format("{0}/*", path));
     foreach (var d in ds) {
         var sp = Path.Combine(path, d);
         this.InnerClear(iso, sp);
         iso.DeleteDirectory(sp);
     }
 }
開發者ID:gruan01,項目名稱:Discuz.Mobi,代碼行數:12,代碼來源:Storage.cs

示例4: DeleteAllFilesInDirectory

 private void DeleteAllFilesInDirectory(IsolatedStorageFile store, string path)
 {
     if (!store.DirectoryExists(path))
     {
         return;
     }
     var files = store.GetFileNames(path + "/*");
     foreach (var file in files)
     {
         store.DeleteFile(path + "/" + file);
     }
 }
開發者ID:fiftin,項目名稱:oblqo,代碼行數:12,代碼來源:AccountManager.cs

示例5: SafeDeleteFile

 public static void SafeDeleteFile(IsolatedStorageFile storage, string fileName)
 {
     try
     {
         if (storage.FileExists(fileName))
         {
             storage.DeleteFile(fileName);
         }
     }
     catch (Exception)
     {
     }
 }
開發者ID:kyvok,項目名稱:TransitWP7,代碼行數:13,代碼來源:IsolatedStorageHelper.cs

示例6: Clear

 public override void Clear()
 {
     base.Clear();
     using ( _storage = IsolatedStorageFile.GetUserStoreForApplication() ) {
         try {
             foreach ( string file in _storage.GetFileNames( CACHE_FOLDER + @"\*" ) ) {
                 _storage.DeleteFile( GetFilePath( file ) );
             }
         }
         catch ( Exception e ) {
             e.ToString();
         }
     }
 }
開發者ID:arakuma,項目名稱:wp_imagetool,代碼行數:14,代碼來源:FsBitmapCache.cs

示例7: RecursiveDeleteDirectory

        public static void RecursiveDeleteDirectory(string directory, IsolatedStorageFile store)
        {
            foreach (var fileName in store.GetFileNames(directory + "\\*"))
            {
                store.DeleteFile(directory + "\\" + fileName);
            }

            foreach (var directoryName in store.GetDirectoryNames(directory + "\\*"))
            {
                RecursiveDeleteDirectory(directory + "\\" + directoryName, store);
            }

            store.DeleteDirectory(directory);
        }
開發者ID:bgourlie,項目名稱:petroledger,代碼行數:14,代碼來源:Util.cs

示例8: DeleteDirectoryRecursively

 public static void DeleteDirectoryRecursively(IsolatedStorageFile storageFile, string directoryName)
 {
     var pattern = directoryName + @"\*";
     var files = storageFile.GetFileNames(pattern);
     foreach (var fileName in files)
     {
         storageFile.DeleteFile(Path.Combine(directoryName, fileName));
     }
     var dirs = storageFile.GetDirectoryNames(pattern);
     foreach (var dirName in dirs)
     {
         DeleteDirectoryRecursively(storageFile, Path.Combine(directoryName, dirName));
     }
     storageFile.DeleteDirectory(directoryName);
 }
開發者ID:Korshunoved,項目名稱:Win10reader,代碼行數:15,代碼來源:CredentialsProvider.cs

示例9: DeleteDirectoryRecursive

 public void DeleteDirectoryRecursive(IsolatedStorageFile isolatedStorageFile, String dirName)
 {
     String pattern = dirName + @"\*";
     String[] files = isolatedStorageFile.GetFileNames(pattern);
     foreach (String fName in files)
     {
         isolatedStorageFile.DeleteFile(Path.Combine(dirName, fName));
     }
     String[] dirs = isolatedStorageFile.GetDirectoryNames(pattern);
     foreach (String dName in dirs)
     {
         DeleteDirectoryRecursive(isolatedStorageFile, Path.Combine(dirName, dName));
     }
     isolatedStorageFile.DeleteDirectory(dirName);
 }
開發者ID:joshgo,項目名稱:NLog,代碼行數:15,代碼來源:IsolatedStorageFileTargetTests.cs

示例10: Write

		// use the caller stack to execute some write operations
		private void Write (IsolatedStorageFile isf)
		{
			isf.CreateDirectory ("testdir");

			string filename = Path.Combine ("testdir", "file");
			using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream (filename, FileMode.Create, isf)) {
			}
			isf.DeleteFile (filename);

			isf.DeleteDirectory ("testdir");
			try {
				isf.Remove ();
			}
			catch (IsolatedStorageException) {
				// fx 1.x doesn't like removing when things "could" still be in use
			}
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:18,代碼來源:IsolatedStorageFileCas.cs

示例11: TryToDeleteAllFiles

        private static void TryToDeleteAllFiles(IsolatedStorageFile storageFolder, string directory)
        {
            if (storageFolder.DirectoryExists(directory))
            {
                try
                {
                    string[] files = storageFolder.GetFileNames(directory);

                    foreach (string file in files)
                    {
                        storageFolder.DeleteFile(directory + file);
                    }
                }
                catch (Exception)
                {
                    // could be in use
                }
            }
        }
開發者ID:hwangtamu,項目名稱:PhotoProcess_0.1,代碼行數:19,代碼來源:FlickerImageHelper.cs

示例12: TryToDeleteAllFiles

        public static void TryToDeleteAllFiles(IsolatedStorageFile storageFolder, string directory)
        {
            if (storageFolder.DirectoryExists(directory))
            {
                try
                {
                    string[] files = storageFolder.GetFileNames(directory);
                    foreach (string File in files)
                    {
                        storageFolder.DeleteFile(directory + files);

                    }
                }
                catch (Exception)
                {
                    //ignoring the exception
                }
             }
        }
開發者ID:njlxyaoxinwei,項目名稱:AroundMe,代碼行數:19,代碼來源:LockscreenHelpers.cs

示例13: DeleteDirectory

        public static void DeleteDirectory(IsolatedStorageFile store, String root)
        {
            String dir = root;

            //  delete file in current dir
            foreach (String file in store.GetFileNames(dir + "/*"))
            {
                store.DeleteFile(dir + "/" + file);
            }

            //  delete sub-dir
            foreach (String subdir in store.GetDirectoryNames(dir + "/*"))
            {
                DeleteDirectory(store, dir + "/" + subdir + "/");
            }

            //  delete current dir
            store.DeleteDirectory(dir);
        }
開發者ID:GhostSoar,項目名稱:JigsawPuzzle,代碼行數:19,代碼來源:ChoosePictures.xaml.cs

示例14: SafeDeleteFile

        public static void SafeDeleteFile(IsolatedStorageFile store)
        {
            try
            {

                store.DeleteFile(filename);

                IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
                if (settings.Contains("errordata"))
                {
                    settings.Remove("erroedata");
                }

            }

            catch (Exception)
            {

            }
        }
開發者ID:npk,項目名稱:razor,代碼行數:20,代碼來源:CrashListener.cs

示例15: Configure

        /// <summary>
        /// Configures the diagnostic log
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="enable"> </param>
        public static void Configure(string fileName, bool enable) {
            try {
                _IsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

                _FileName = fileName;

#if DEBUG
                if (_IsolatedStorage.FileExists(_FileName)) {
                    _IsolatedStorage.DeleteFile(_FileName);
                }
#endif

                IsEnabled = enable;
                if (enable) {
                    WriteLogFileHeader();
                }
            } catch (Exception ex) {
                Debug.WriteLine(ex.ToString());
            }
        }
開發者ID:Sebazzz,項目名稱:SDammann.WindowsPhone.Utils,代碼行數:25,代碼來源:DiagnosticHelper.cs


注:本文中的System.IO.IsolatedStorage.IsolatedStorageFile.DeleteFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。