WebExceptionStatus 枚举


WebException 类定义状态代码。Defines status codes for the WebException class.

此 API 支持产品基础结构,不能在代码中直接使用。

public enum class WebExceptionStatus
public enum WebExceptionStatus
type WebExceptionStatus = 
Public Enum WebExceptionStatus


CacheEntryNotFound 18

未找到指定的缓存项。The specified cache entry was not found.

ConnectFailure 2

无法在传输级别联系到远程服务点。The remote service point could not be contacted at the transport level.

ConnectionClosed 8

连接过早关闭。The connection was prematurely closed.

KeepAliveFailure 12

指定 Keep-alive 标头的请求连接意外关闭。The connection for a request that specifies the Keep-alive header was closed unexpectedly.

MessageLengthLimitExceeded 17

从服务器发送请求或接收响应时,接收到的消息超出指定限制。A message was received that exceeded the specified limit when sending a request or receiving a response from the server.

NameResolutionFailure 1

名称解析服务未能解析主机名。The name resolver service could not resolve the host name.

Pending 13

内部异步请求处于挂起状态。An internal asynchronous request is pending.

PipelineFailure 5

该请求是管线请求,并且连接未接收到响应即关闭。The request was a pipelined request and the connection was closed before the response was received.

ProtocolError 7

从服务器接收的响应是完整的,但指示了一个协议级别的错误。The response received from the server was complete but indicated a protocol-level error. 例如,HTTP 协议错误(如 401 访问被拒绝)可能使用此状态。For example, an HTTP protocol error such as 401 Access Denied would use this status.

ProxyNameResolutionFailure 15

名称解析程序服务无法解析代理主机名。The name resolver service could not resolve the proxy host name.

ReceiveFailure 3

无法从远程服务器接收完整的响应。A complete response was not received from the remote server.

RequestCanceled 6

取消了请求,调用了 Abort() 方法,或者发生了不可分类的错误。The request was canceled, the Abort() method was called, or an unclassifiable error occurred. 这是 Status 的默认值。This is the default value for Status.

RequestProhibitedByCachePolicy 19

缓存策略不允许该请求。The request was not permitted by the cache policy. 一般而言,当请求不可缓存和有效策略禁止向服务器发送请求时会发生这种情况。In general, this occurs when a request is not cacheable and the effective policy prohibits sending the request to the server. 如果请求方法暗示请求正文存在,请求方法需要与服务器直接交互,或者请求包含条件标头,则用户可能会收到此状态。You might receive this status if a request method implies the presence of a request body, a request method requires direct interaction with the server, or a request contains a conditional header.

RequestProhibitedByProxy 20

代理不允许此请求。This request was not permitted by the proxy.

SecureChannelFailure 10

使用 SSL 建立连接时发生错误。An error occurred while establishing a connection using SSL.

SendFailure 4

无法向远程服务器发送完整的请求。A complete request could not be sent to the remote server.

ServerProtocolViolation 11

服务器响应不是有效的 HTTP 响应。The server response was not a valid HTTP response.

Success 0

未遇到任何错误。No error was encountered.

Timeout 14

在请求的超时期限内未收到任何响应。No response was received during the time-out period for a request.

TrustFailure 9

无法验证服务器证书。A server certificate could not be validated.

UnknownError 16

出现未知类型的异常。An exception of unknown type has occurred.


WebExceptionStatus 枚举定义分配给 Status 属性的状态代码。The WebExceptionStatus enumeration defines the status codes assigned to the Status property.