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 メソッドを使用して、その内容が空になった後に分離ストレージ ファイルを削除します。 分離ストレージ内のストアを削除する方法の例では、Remove メソッドの使用も示します。

    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

注釈

Caution

このメソッドは、スコープ全体と、含まれているすべてのディレクトリとファイルを取り消し不能に削除します。

ストア内のいずれかのディレクトリまたはファイルが使用中の場合、ストアの削除の試行は失敗し、ストアは削除対象としてマークされます。 その後、ストアを変更しようとすると、 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値のビットごとの組み合わせ。

例外

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

注釈

Caution

このメソッドは、スコープ全体と、含まれているすべてのディレクトリとファイルを取り消し不能に削除します。

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

こちらもご覧ください

適用対象