当前位置: 首页>>代码示例>>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;未经允许,请勿转载。