IsolatedStorageFile.Remove メソッド

定義

分離ストレージ スコープとそのスコープ内のすべての内容を削除します。

オーバーロード

Remove()

分離ストレージ スコープとそのスコープ内のすべての内容を削除します。

Remove(IsolatedStorageScope)

すべての ID に対して指定した分離ストレージ スコープを削除します。

Remove()

分離ストレージ スコープとそのスコープ内のすべての内容を削除します。

public:
 override void Remove();
public override void Remove ();
override this.Remove : unit -> unit
Public Overrides Sub Remove ()

例外

分離ストアを削除できません。

次のコード例では、メソッドを Remove 使用して、分離ストレージ ファイルの内容が空になった後に削除します。 分離Storageのストアを削除する方法の例では、メソッドのRemove使用方法も示します。

array<String^>^dirNames = isoFile->GetDirectoryNames( "*" );
array<String^>^fileNames = isoFile->GetFileNames( "*" );

// List directories currently in this Isolated Storage.
if ( dirNames->Length > 0 )
{
   for ( int i = 0; i < dirNames->Length; ++i )
   {
      Console::WriteLine( "Directory Name: {0}", dirNames[ i ] );

   }
}


// 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 )
   {
      Console::WriteLine( "File Name: {0}", fileNames[ i ] );

   }
}
    String[] dirNames = isoFile.GetDirectoryNames("*");
    String[] fileNames = isoFile.GetFileNames("Archive\\*");

    // Delete all the files currently in the Archive directory.

    if (fileNames.Length > 0)
    {
        for (int i = 0; i < fileNames.Length; ++i)
        {
            // Delete the files.
            isoFile.DeleteFile("Archive\\" + fileNames[i]);
        }
        // Confirm that no files remain.
        fileNames = isoFile.GetFileNames("Archive\\*");
    }

    if (dirNames.Length > 0)
    {
        for (int i = 0; i < dirNames.Length; ++i)
        {
            // Delete the Archive directory.
        }
    }
    dirNames = isoFile.GetDirectoryNames("*");
    isoFile.Remove();
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}
Dim dirNames As String() = isoFile.GetDirectoryNames("*")
Dim fileNames As String() = isoFile.GetFileNames("*")
Dim name As String

' List directories currently in this Isolated Storage.
If dirNames.Length > 0 Then

    For Each name In dirNames
        Console.WriteLine("Directory Name: " & name)
    Next name
End If

' 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
        Console.WriteLine("File Name: " & name)
    Next name
End If

注釈

注意事項

このメソッドは、スコープ全体と、含まれているすべてのディレクトリとファイルを元に戻すことはできません。

ストア内のいずれかのディレクトリまたはファイルが使用中の場合、ストアの削除試行は失敗し、ストアは削除対象としてマークされます。 ストアを変更する後続の試行では、次の値がスローされます IsolatedStorageException

こちらもご覧ください

適用対象

Remove(IsolatedStorageScope)

すべての ID に対して指定した分離ストレージ スコープを削除します。

public:
 static void Remove(System::IO::IsolatedStorage::IsolatedStorageScope scope);
public static void Remove (System.IO.IsolatedStorage.IsolatedStorageScope scope);
static member Remove : System.IO.IsolatedStorage.IsolatedStorageScope -> unit
Public Shared Sub Remove (scope As IsolatedStorageScope)

パラメーター

scope
IsolatedStorageScope

IsolatedStorageScope 値のビットごとの組み合わせ。

例外

分離ストアを削除できません。

注釈

注意事項

このメソッドは、スコープ全体と、含まれているすべてのディレクトリとファイルを元に戻すことはできません。

ストア内のいずれかのディレクトリまたはファイルが使用中の場合、ストアの削除試行は失敗し、ストアは削除対象としてマークされます。 ストアを変更する後続の試行では、次の値がスローされます IsolatedStorageException

こちらもご覧ください

適用対象