IsolatedStorageFile.DeleteFile メソッド
アセンブリ: mscorlib (mscorlib.dll 内)




Public Sub DeleteFiles() Try Dim isoFile As IsolatedStorageFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly Or IsolatedStorageScope.Domain, GetType(System.Security.Policy.Url), GetType(System.Security.Policy.Url)) Dim name As String Dim dirNames As String() = isoFile.GetDirectoryNames("*") Dim fileNames As String() = isoFile.GetFileNames("*") ' List the files currently in this Isolated Storage. ' The list represents all users who have personal ' preferences stored for this application. If fileNames.Length > 0 Then For Each name In fileNames ' Delete the files. isoFile.DeleteFile(name) Next name 'Confirm no files are left. fileNames = isoFile.GetFileNames("*") End If Catch ex As Exception Console.WriteLine(ex.ToString()) End Try End Sub 'DeleteFiles
public void DeleteFiles() { try { IsolatedStorageFile isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain, typeof(System.Security.Policy.Url), typeof(System.Security.Policy.Url)); String[] dirNames = isoFile.GetDirectoryNames("*"); String[] fileNames = isoFile.GetFileNames("*"); // List the files currently in this Isolated Storage. // The list represents all users who have personal // preferences stored for this application. if (fileNames.Length > 0) { for (int i = 0; i < fileNames.Length; ++i) { // Delete the files. isoFile.DeleteFile(fileNames[i]); } // Confirm that no files remain. fileNames = isoFile.GetFileNames("*"); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
void DeleteFiles() { try { IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetStore( static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain), System::Security::Policy::Url::typeid, System::Security::Policy::Url::typeid ); array<String^>^dirNames = isoFile->GetDirectoryNames( "*" ); array<String^>^fileNames = isoFile->GetFileNames( "*" ); // List the files currently in this Isolated Storage. // The list represents all users who have personal // preferences stored for this application. if ( fileNames->Length > 0 ) { for ( int i = 0; i < fileNames->Length; ++i ) { //Delete the files. isoFile->DeleteFile( fileNames[ i ] ); } fileNames = isoFile->GetFileNames( "*" ); } isoFile->Close(); } catch ( Exception^ e ) { Console::WriteLine( e->ToString() ); } }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- IsolatedStorageFile.DeleteFile メソッドのページへのリンク