共用方式為


IsolatedStorageFileStream.CanWrite 屬性

定義

取得布林值,指出您是否可以寫入檔案。

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

屬性值

如果可以寫入 IsolatedStorageFileStream 物件,則為 true;否則為 false

範例

下列程式代碼範例示範如何使用 CanWrite 屬性,以檢查是否可在呼叫 WriteBeginWrite 方法之前讀取數據流。 如需此範例的完整內容,請參閱概 IsolatedStorageFileStream 觀。

Console::WriteLine( "Is the target file writable? {0}", (target->CanWrite ? (String^)"true" : "false") );
Console.WriteLine("Is the target file writable? " + (target.CanWrite ? "true" : "false"));
If target.CanWrite Then canWrite = True Else canWrite = False
Console.WriteLine("Is the target file writable? " & canWrite)

備註

使用這個屬性來判斷是否可以 IsolatedStorageFileStream 寫入物件。

適用於