SocketException.ErrorCode 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會收到與此例外相關的錯誤代碼。
public:
virtual property int ErrorCode { int get(); };
public override int ErrorCode { get; }
member this.ErrorCode : int
Public Overrides ReadOnly Property ErrorCode As Integer
屬性值
一個與此例外相關的整數錯誤碼。
備註
該 ErrorCode 屬性包含與導致該例外的錯誤相關的錯誤代碼。
無參數建構子將 SocketException 屬性設定 ErrorCode 為最後一次發生的作業系統錯誤。 欲了解更多關於 socket 錯誤碼的資訊,請參閱 Windows Sockets 版本 2 API 錯誤碼 文件。