StreamReader.Close StreamReader.Close StreamReader.Close StreamReader.Close Method

定義

關閉 StreamReader 物件和基礎資料流,並釋放任何與讀取器相關聯的系統資源。Closes the StreamReader object and the underlying stream, and releases any system resources associated with the reader.

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

備註

這個方法會覆TextReader.Close寫方法。This method overrides the TextReader.Close method.

這個執行CloseDispose呼叫方法,並傳遞一個true值。This implementation of Close calls the Dispose method, passing a true value.

呼叫Close之後,讀取器上的任何作業可能會引發例外狀況。Following a call to Close, any operations on the reader might raise exceptions.

適用於

另請參閱