IsolatedStorageFileStream.WriteByte(Byte) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會寫入一個位元組給 IsolatedStorageFileStream 物件。
public:
override void WriteByte(System::Byte value);
public override void WriteByte(byte value);
override this.WriteByte : byte -> unit
Public Overrides Sub WriteByte (value As Byte)
參數
- value
- Byte
用來寫入隔離儲存檔案的位元組值。
例外狀況
寫入嘗試超過物件的 IsolatedStorageFileStream 配額。
範例
以下程式碼範例展示了如何 WriteByte 使用此方法從物件讀取資料 IsolatedStorageFileStream 。 關於此範例的完整背景,請參閱 IsolatedStorageFileStream 概述。
Console.WriteLine("Writing data to the new file.");
while (source.Position < source.Length)
{
inputChar = (byte)source.ReadByte();
target.WriteByte(inputChar);
}
// Determine the size of the IsolatedStorageFileStream
// by checking its Length property.
Console.WriteLine("Total Bytes Read: " + source.Length);
Console.WriteLine("Writing data to the new file.")
While source.Position < source.Length
inputChar = CByte(source.ReadByte())
target.WriteByte(inputChar)
End While
' Determine the size of the IsolatedStorageFileStream
' by checking its Length property.
Console.WriteLine(("Total Bytes Read: " & source.Length))