Share via


IsolatedStorageFile.Remove 메서드

정의

격리된 스토리지 범위와 모든 콘텐츠를 제거합니다.

오버로드

Remove()

격리된 스토리지 범위와 모든 콘텐츠를 제거합니다.

Remove(IsolatedStorageScope)

모든 ID에 대해 지정된 격리된 스토리지 범위를 제거합니다.

Remove()

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

격리된 스토리지 범위와 모든 콘텐츠를 제거합니다.

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

예외

격리된 저장소를 삭제할 수 없는 경우

예제

다음 코드 예제에서는 Remove 메서드를 사용하여 격리된 스토리지 파일의 내용을 비운 후 해당 파일을 삭제합니다. 방법: 격리된 스토리지에서 저장소 삭제 예제는 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

설명

주의

이 메서드는 전체 scope 및 포함된 모든 디렉터리와 파일을 취소할 수 없이 제거합니다.

저장소에 있는 디렉터리 또는 파일이 사용 중인 경우 저장소에 대한 제거 시도가 실패하고 저장소가 제거로 표시됩니다. 저장소를 수정하려는 후속 시도는 을 throw합니다 IsolatedStorageException.

추가 정보

적용 대상

Remove(IsolatedStorageScope)

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

모든 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 값의 비트 조합입니다.

예외

격리된 저장소를 제거할 수 없는 경우

설명

주의

이 메서드는 전체 scope 및 포함된 모든 디렉터리와 파일을 취소할 수 없이 제거합니다.

저장소에 있는 디렉터리 또는 파일이 사용 중인 경우 저장소에 대한 제거 시도가 실패하고 저장소가 제거로 표시됩니다. 저장소를 수정하려는 후속 시도는 을 throw합니다 IsolatedStorageException.

추가 정보

적용 대상