System.Net 命名空间

System.Net 命名空间为当前网络上使用的多种协议提供了简单的编程接口。 The System.Net namespace provides a simple programming interface for many of the protocols used on networks today. WebRequestWebResponse 类形成了所谓的可插接式协议的基础,可插接式协议是网络服务的一种实现,它使您能够开发出使用 Internet 资源的应用程序,而不必考虑各种不同协议的具体细节。 The WebRequest and WebResponse classes form the basis of what are called pluggable protocols, an implementation of network services that enables you to develop applications that use Internet resources without worrying about the specific details of the individual protocols. System.Net 命名空间中的类可用于开发 Windows 应用商店应用程序或桌面应用程序。 Classes in the System.Net namespace can be used to develop Windows Store apps or desktop apps. 当使用 Windows 应用商店应用程序时,System.Net 命名空间中的类将受网络隔离功能(Windows 开发人员预览版使用的一部分应用程序安全模型)的影响。 When used in a Windows Store app, classes in the System.Net namespace are affected by network isolation feature, part of the application security model used by the Windows Developer Preview. 必须在应用程序清单中为本系统的 Windows 应用商店应用程序启动相应的网络功能,以便允许 Windows 应用商店应用程序的网络访问。 The appropriate network capabilities must be enabled in the app manifest for a Windows Store app for the system to allow network access by a Windows Store app. 有关详细信息,请参阅适用于 Windows Store 应用的网络隔离 For more information, see the Network Isolation for Windows Store Apps.

AuthenticationManager

管理客户端身份验证过程中调用的身份验证模块。Manages the authentication modules called during the client authentication process.

Authorization

包含 Internet 服务器的身份验证消息。Contains an authentication message for an Internet server.

Cookie

提供一组用于管理 Cookie 的属性和方法。Provides a set of properties and methods that are used to manage cookies. 此类不能被继承。This class cannot be inherited.

CookieCollection

Cookie 类的实例提供集合容器。Provides a collection container for instances of the Cookie class.

CookieContainer

CookieCollection 对象的集合提供容器。Provides a container for a collection of CookieCollection objects.

CookieException

CookieContainer 添加 Cookie 出错时引发的异常。The exception that is thrown when an error is made adding a Cookie to a CookieContainer.

CredentialCache

为多个凭据提供存储空间。Provides storage for multiple credentials.

Dns

提供简单的域名解析功能。Provides simple domain name resolution functionality.

DnsEndPoint

将网络终结点表示为主机名或 IP 地址和端口号的字符串表示形式。Represents a network endpoint as a host name or a string representation of an IP address and a port number.

DnsPermission

控制对网络上域名系统 (DNS) 服务器的访问权限。Controls rights to access Domain Name System (DNS) servers on the network.

DnsPermissionAttribute

指定从域名服务器中请求信息的权限。Specifies permission to request information from Domain Name Servers.

DownloadDataCompletedEventArgs

DownloadDataCompleted 事件提供数据。Provides data for the DownloadDataCompleted event.

DownloadProgressChangedEventArgs

WebClientDownloadProgressChanged 事件提供数据。Provides data for the DownloadProgressChanged event of a WebClient.

DownloadStringCompletedEventArgs

DownloadStringCompleted 事件提供数据。Provides data for the DownloadStringCompleted event.

EndPoint

标识网络地址。Identifies a network address. 这是一个 abstract 类。This is an abstract class.

EndpointPermission

定义由 SocketPermission 实例授权的终结点。Defines an endpoint that is authorized by a SocketPermission instance.

FileWebRequest

提供 WebRequest 类的文件系统实现。Provides a file system implementation of the WebRequest class.

FileWebResponse

提供 WebResponse 类的文件系统实现。Provides a file system implementation of the WebResponse class.

FtpWebRequest

实现文件传输协议 (FTP) 客户端。Implements a File Transfer Protocol (FTP) client.

FtpWebResponse

封装文件传输协议 (FTP) 服务器对请求的响应。Encapsulates a File Transfer Protocol (FTP) server's response to a request.

GlobalProxySelection

包含所有 HTTP 请求的全局默认代理实例。Contains a global default proxy instance for all HTTP requests.

HttpListener

提供一个简单的、可通过编程方式控制的 HTTP 协议侦听器。Provides a simple, programmatically controlled HTTP protocol listener. 此类不能被继承。This class cannot be inherited.

HttpListenerBasicIdentity

包含来自基本身份验证请求的用户名和密码。Holds the user name and password from a basic authentication request.

HttpListenerContext

提供对 HttpListener 类使用的请求和响应对象的访问。Provides access to the request and response objects used by the HttpListener class. 此类不能被继承。This class cannot be inherited.

HttpListenerException

处理 HTTP 请求发生错误时引发的异常。The exception that is thrown when an error occurs processing an HTTP request.

HttpListenerPrefixCollection

表示用于存储 HttpListener 对象的统一资源标识符 (URI) 前缀的集合。Represents the collection used to store Uniform Resource Identifier (URI) prefixes for HttpListener objects.

HttpListenerRequest

描述传入 HttpListener 对象的 HTTP 请求。Describes an incoming HTTP request to an HttpListener object. 此类不能被继承。This class cannot be inherited.

HttpListenerResponse

表示对 HttpListener 对象正在处理的请求的响应。Represents a response to a request being handled by an HttpListener object.

HttpListenerTimeoutManager

要用于 HttpListener 对象的超时管理器。The timeout manager to use for an HttpListener object.

HttpVersion

定义 HttpWebRequestHttpWebResponse 类支持的 HTTP 版本号。Defines the HTTP version numbers that are supported by the HttpWebRequest and HttpWebResponse classes.

HttpWebRequest

提供 WebRequest 类的 HTTP 特定的实现。Provides an HTTP-specific implementation of the WebRequest class.

HttpWebResponse

提供 WebResponse 类的 HTTP 特定的实现。Provides an HTTP-specific implementation of the WebResponse class.

IPAddress

提供 Internet 协议 (IP) 地址。Provides an Internet Protocol (IP) address.

IPEndPoint

将网络端点表示为 IP 地址和端口号。Represents a network endpoint as an IP address and a port number.

IPEndPointCollection

表示用于将网络终结点存储为 IPEndPoint 对象的集合。Represents a collection used to store network endpoints as IPEndPoint objects.

IPHostEntry

为 Internet 主机地址信息提供容器类。Provides a container class for Internet host address information.

NetworkCredential

为基于密码的身份验证方案(如基本、简要、NTLM 和 Kerberos 身份验证)提供凭据。Provides credentials for password-based authentication schemes such as basic, digest, NTLM, and Kerberos authentication.

NetworkProgressChangedEventArgs

提供网络进度已更改事件的数据。Provides data for the network progress changed event.

OpenReadCompletedEventArgs

OpenReadCompleted 事件提供数据。Provides data for the OpenReadCompleted event.

OpenWriteCompletedEventArgs

OpenWriteCompleted 事件提供数据。Provides data for the OpenWriteCompleted event.

ProtocolViolationException

使用网络协议期间出错时引发的异常。The exception that is thrown when an error is made while using a network protocol.

ServicePoint

提供 HTTP 连接的连接管理。Provides connection management for HTTP connections.

ServicePointManager

管理 ServicePoint 对象集合。Manages the collection of ServicePoint objects.

SocketAddress

存储 EndPoint 派生类的序列化信息。Stores serialized information from EndPoint derived classes.

SocketPermission

控制在传输地址上建立或接受连接的权利。Controls rights to make or accept connections on a transport address.

SocketPermissionAttribute

指定安全操作以控制 Socket 连接。Specifies security actions to control Socket connections. 此类不能被继承。This class cannot be inherited.

TransportContext

TransportContext 类提供有关基础传输层的附加上下文。The TransportContext class provides additional context about the underlying transport layer.

UiSynchronizationContext

为同步模型中使用的托管 UI 提供同步上下文。Provides the synchronization context for the managed UI used in synchronization models.

UploadDataCompletedEventArgs

UploadDataCompleted 事件提供数据。Provides data for the UploadDataCompleted event.

UploadFileCompletedEventArgs

UploadFileCompleted 事件提供数据。Provides data for the UploadFileCompleted event.

UploadProgressChangedEventArgs

WebClientUploadProgressChanged 事件提供数据。Provides data for the UploadProgressChanged event of a WebClient.

UploadStringCompletedEventArgs

UploadStringCompleted 事件提供数据。Provides data for the UploadStringCompleted event.

UploadValuesCompletedEventArgs

UploadValuesCompleted 事件提供数据。Provides data for the UploadValuesCompleted event.

WebClient

提供用于将数据发送到由 URI 标识的资源及从这样的资源接收数据的常用方法。Provides common methods for sending data to and receiving data from a resource identified by a URI.

WebException

通过可插接协议访问网络期间出错时引发的异常。The exception that is thrown when an error occurs while accessing the network through a pluggable protocol.

WebHeaderCollection

包含与请求或响应关联的协议标头。Contains protocol headers associated with a request or response.

WebPermission

控制访问 HTTP Internet 资源的权限。Controls rights to access HTTP Internet resources.

WebPermissionAttribute

指定权限以访问 Internet 资源。Specifies permission to access Internet resources. 此类不能被继承。This class cannot be inherited.

WebProxy

包含 WebRequest 类的 HTTP 代理设置。Contains HTTP proxy settings for the WebRequest class.

WebRequest

对统一资源标识符 (URI) 发出请求。Makes a request to a Uniform Resource Identifier (URI). 这是一个 abstract 类。This is an abstract class.

WebRequestMethods

WebRequestMethods.FtpWebRequestMethods.FileWebRequestMethods.Http 类的容器类。Container class for WebRequestMethods.Ftp, WebRequestMethods.File, and WebRequestMethods.Http classes. 此类不能被继承。This class cannot be inherited.

WebRequestMethods.File

表示可用于 FILE 请求的文件协议方法的类型。Represents the types of file protocol methods that can be used with a FILE request. 此类不能被继承。This class cannot be inherited.

WebRequestMethods.Ftp

表示可与 FTP 请求一起使用的 FTP 协议方法的类型。Represents the types of FTP protocol methods that can be used with an FTP request. 此类不能被继承。This class cannot be inherited.

WebRequestMethods.Http

表示可与 HTTP 请求一起使用的 HTTP 协议方法的类型。Represents the types of HTTP protocol methods that can be used with an HTTP request.

WebResponse

提供来自统一资源标识符 (URI) 的响应。Provides a response from a Uniform Resource Identifier (URI). 这是一个 abstract 类。This is an abstract class.

WebUtility

提供用于在处理 Web 请求时编码和解码 URL 的方法。Provides methods for encoding and decoding URLs when processing Web requests.

WriteStreamClosedEventArgs

WriteStreamClosed 事件提供数据。Provides data for the WriteStreamClosed event.

接口

IAuthenticationModule

为 Web 客户端身份验证模块提供基本身份验证接口。Provides the base authentication interface for Web client authentication modules.

ICertificatePolicy

验证服务器证书。Validates a server certificate.

ICredentialPolicy

定义凭据策略,该凭据策略将用于使用 WebRequest 及其派生类发出的资源请求。Defines the credential policy to be used for resource requests that are made using WebRequest and its derived classes.

ICredentials

提供用于为 Web 客户端身份验证检索凭据的基身份验证接口。Provides the base authentication interface for retrieving credentials for Web client authentication.

ICredentialsByHost

提供用于检索主机、端口或身份验证类型的凭据的接口。Provides the interface for retrieving credentials for a host, port, and authentication type.

INetworkProgress

提供有关通过网络发送数据的网络进度的信息。Provides information on network progress in sending data over the network.

IUnsafeWebRequestCreate

对统一资源标识符 (URI) 创建一个不安全的 WebRequestCreates an unsafe WebRequest to a Uniform Resource Identifier (URI).

IWebProxy

提供基接口以实现对 WebRequest 类的代理访问。Provides the base interface for implementation of proxy access for the WebRequest class.

IWebProxyScript

提供要加载的基接口并执行脚本以进行自动代理检测。Provides the base interface to load and execute scripts for automatic proxy detection.

IWebRequestCreate

提供用于创建 WebRequest 实例的基接口。Provides the base interface for creating WebRequest instances.

枚举

AuthenticationSchemes

指定用于身份验证的协议。Specifies protocols for authentication.

DecompressionMethods

表示文件压缩和解压缩编码格式,该格式将用来压缩在 HttpWebRequest 的响应中收到的数据。Represents the file compression and decompression encoding format to be used to compress the data received in response to an HttpWebRequest.

FtpStatusCode

指定为文件传输协议 (FTP) 操作返回的状态代码。Specifies the status codes returned for a File Transfer Protocol (FTP) operation.

HttpRequestHeader

可能在客户端请求中指定的 HTTP 标头。The HTTP headers that may be specified in a client request.

HttpResponseHeader

可以在服务器响应中指定的 HTTP 标头。The HTTP headers that can be specified in a server response.

HttpStatusCode

包含为 HTTP 定义的状态代码的值。Contains the values of status codes defined for HTTP.

NetworkAccess

指定网络访问权限。Specifies network access permissions.

SecurityProtocolType

指定 Schannel 安全包支持的安全协议。Specifies the security protocols that are supported by the Schannel security package.

TransportType

SocketPermissionSocket 类定义传输类型。Defines transport types for the SocketPermission and Socket classes.

WebExceptionStatus

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

委托

AuthenticationSchemeSelector

HttpListener 实例选择身份验证方案。Selects the authentication scheme for an HttpListener instance.

BindIPEndPoint

表示指定 ServicePoint 的本地 Internet 协议地址和端口号的方法。Represents the method that specifies a local Internet Protocol address and port number for a ServicePoint.

CipherSuitesCallback
DownloadDataCompletedEventHandler

表示将用来处理 DownloadDataCompletedWebClient 事件的方法。Represents the method that will handle the DownloadDataCompleted event of a WebClient.

DownloadProgressChangedEventHandler

表示将用来处理 DownloadProgressChangedWebClient 事件的方法。Represents the method that will handle the DownloadProgressChanged event of a WebClient.

DownloadStringCompletedEventHandler

表示将用来处理 DownloadStringCompletedWebClient 事件的方法。Represents the method that will handle the DownloadStringCompleted event of a WebClient.

HttpContinueDelegate

表示当客户端接收到连续响应时通知调用方的方法。Represents the method that notifies callers when a continue response is received by the client.

HttpListener.ExtendedProtectionSelector

在确定要用于每个 HttpListener 请求的 ExtendedProtectionPolicy 时调用的委托。A delegate called to determine the ExtendedProtectionPolicy to use for each HttpListener request.

OpenReadCompletedEventHandler

表示将用来处理 OpenReadCompletedWebClient 事件的方法。Represents the method that will handle the OpenReadCompleted event of a WebClient.

OpenWriteCompletedEventHandler

表示将用来处理 OpenWriteCompletedWebClient 事件的方法。Represents the method that will handle the OpenWriteCompleted event of a WebClient.

UploadDataCompletedEventHandler

表示将用来处理 UploadDataCompletedWebClient 事件的方法。Represents the method that will handle the UploadDataCompleted event of a WebClient.

UploadFileCompletedEventHandler

表示将用来处理 UploadFileCompletedWebClient 事件的方法。Represents the method that will handle the UploadFileCompleted event of a WebClient.

UploadProgressChangedEventHandler

表示将用来处理 UploadProgressChangedWebClient 事件的方法。Represents the method that will handle the UploadProgressChanged event of a WebClient.

UploadStringCompletedEventHandler

表示将用来处理 UploadStringCompletedWebClient 事件的方法。Represents the method that will handle the UploadStringCompleted event of a WebClient.

UploadValuesCompletedEventHandler

表示将用来处理 UploadValuesCompletedWebClient 事件的方法。Represents the method that will handle the UploadValuesCompleted event of a WebClient.

WriteStreamClosedEventHandler

表示将要处理 WriteStreamClosedWebClient 事件的方法。Represents the method that will handle the WriteStreamClosed event of a WebClient.

另请参阅