SocketException.ErrorCode SocketException.ErrorCode SocketException.ErrorCode SocketException.ErrorCode Property

定义

获取与此异常关联的错误代码。Gets the error code that is associated with this exception.

public:
 virtual property int ErrorCode { int get(); };
public override int ErrorCode { get; }
member this.ErrorCode : int
Public Overrides ReadOnly Property ErrorCode As Integer

属性值

与此异常关联的整数错误代码。An integer error code that is associated with this exception.

注解

ErrorCode属性包含与导致异常的错误关联的错误代码。The ErrorCode property contains the error code that is associated with the error that caused the exception.

的无参数构造SocketException函数ErrorCode将属性设置为上次发生的操作系统错误。The parameterless constructor for SocketException sets the ErrorCode property to the last operating system error that occurred. 有关套接字错误代码的详细信息, 请参阅Windows 套接字版本 2 API 错误代码文档。For more information about socket error codes, see the Windows Sockets version 2 API error code documentation.

适用于