IsolatedStorageFileStream.CanRead 속성

정의

파일을 읽을 수 있는지 여부를 나타내는 부울 값을 가져옵니다.

public:
 virtual property bool CanRead { bool get(); };
public override bool CanRead { get; }
member this.CanRead : bool
Public Overrides ReadOnly Property CanRead As Boolean

속성 값

true 개체를 읽을 수 있으면 IsolatedStorageFileStream 이고, 읽을 수 없으면 false입니다.

예제

다음 코드 예제를 사용 CanRead 하는 방법을 보여 줍니다.는 속성으로 또는 메서드를 호출 ReadBeginRead 하기 전에 스트림을 읽을 수 있는지 여부를 확인 하는 검사. 이 예제의 전체 컨텍스트는 개요를 참조하세요 IsolatedStorageFileStream .

// This is the stream to which data will be written.
IsolatedStorageFileStream^ source = gcnew IsolatedStorageFileStream( this->userName,FileMode::OpenOrCreate,isoFile );

// This is the stream from which data will be read.
Console::WriteLine( "Is the source file readable?  {0}", (source->CanRead ? (String^)"true" : "false") );
Console::WriteLine( "Creating new IsolatedStorageFileStream for Archive." );

// Open or create a writable file.
IsolatedStorageFileStream^ target = gcnew IsolatedStorageFileStream( String::Concat("Archive\\",this->userName),FileMode::OpenOrCreate,FileAccess::Write,FileShare::Write,isoFile );

IsolatedStorageFileStream source =
    new IsolatedStorageFileStream(this.userName, FileMode.OpenOrCreate,
    isoFile);
// This is the stream from which data will be read.
Console.WriteLine("Is the source file readable? " + (source.CanRead ? "true" : "false"));
Console.WriteLine("Creating new IsolatedStorageFileStream for Archive.");

// Open or create a writable file.
IsolatedStorageFileStream target =
    new IsolatedStorageFileStream("Archive\\ " + this.userName,
    FileMode.OpenOrCreate,
    FileAccess.Write,
    FileShare.Write,
    isoFile);
' Open or create a writable file.
Dim target As New IsolatedStorageFileStream("Archive\ " & Me.userName, _
     FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write, isoFile)

설명

개체를 읽을 수 있는지 여부를 IsolatedStorageFileStream 확인 하려면이 속성을 사용 합니다.

적용 대상