以 .NET Framework 進行網路程式設計Network Programming in the .NET Framework

Microsoft .NET Framework 提供有層次、可擴充和網際網路服務的 Managed 實作,可以迅速而簡易地整合到您的應用程式。The Microsoft .NET Framework provides a layered, extensible, and managed implementation of Internet services that can be quickly and easily integrated into your applications. 您的網路應用程式可以建置在可外掛式通訊協定上,以便自動利用新的網際網路通訊協定,或者也可以使用 Windows Socket 介面的 Managed 實作,以便搭配使用通訊端層級上的網路。Your network applications can build on pluggable protocols to automatically take advantage of new Internet protocols, or they can use a managed implementation of the Windows socket interface to work with the network on the socket level.

本節內容In This Section

可插式通訊協定簡介Introducing Pluggable Protocols
說明如何存取網際網路資源而不用考慮需要的存取通訊協定。Describes how to access an Internet resource without regard to the access protocol that it requires.

要求資料Requesting Data
說明如何使用可外掛式通訊協定從網際網路資源上傳和下載資料。Explains how to use pluggable protocols to upload and download data from Internet resources.

可插式通訊協定程式設計Programming Pluggable Protocols
說明如何衍生通訊協定特定類別以實作可外掛式通訊協定。Explains how to derive protocol-specific classes to implement pluggable protocols.

使用應用程式通訊協定Using Application Protocols
說明如何設計使用網路通訊協定 (例如 TCP、UDP 和 HTTP) 的應用程式。Describes programming applications that take advantage of network protocols such as TCP, UDP, and HTTP.

網際網路通訊協定第6版Internet Protocol Version 6
說明在目前版本的網際網路通訊協定組合 (IPv4) 之上網際網路通訊協定第 6 版 (IPv6) 的優點,描述 IPv6 位址、路由和自動設定,以及如何啟用和停用 IPv6。Describes the advantages of Internet Protocol version 6 (IPv6) over the current version of the Internet Protocol suite (IPv4), describes IPv6 addressing, routing and auto-configuration, and how to enable and disable IPv6.

設定網際網路應用程式Configuring Internet Applications
說明如何使用 .NET Framework 組態檔以設定網際網路應用程式。Explains how to use the .NET Framework configuration files to configure Internet applications.

以 .NET Framework 進行網路追蹤Network Tracing in the .NET Framework
說明如何使用網路追蹤以取得有關方法叫用及 Managed 應用程式所產生的網路流量的資訊。Explains how to use network tracing to get information about method invocations and network traffic generated by a managed application.

網路應用程式的快取管理Cache Management for Network Applications
說明如何針對使用 System.Net.WebClientSystem.Net.WebRequestSystem.Net.HttpWebRequest 類別的應用程式來使用快取。Describes how to use caching for applications that use the System.Net.WebClient, System.Net.WebRequest, and System.Net.HttpWebRequest classes.

網路程式設計的安全性Security in Network Programming
描述如何使用標準網際網路安全性和驗證技術。Describes how to use standard Internet security and authentication techniques.

System.Net 類別的最佳做法Best Practices for System.Net Classes
提供可讓您善用網際網路應用程式的祕訣和訣竅。Provides tips and tricks for getting the most out of your Internet applications.

透過 Proxy 存取網際網路Accessing the Internet Through a Proxy
描述如何設定 Proxy。Describes how to configure proxies.

NetworkInformationNetworkInformation
描述如何蒐集網路事件、變更、統計資料和屬性的相關資訊,以及說明如何判斷遠端主機是否可以使用 System.Net.NetworkInformation.Ping 類別取得聯繫。Describes how to gather information about network events, changes, statistics, and properties and also explains how to determine whether a remote host is reachable by using the System.Net.NetworkInformation.Ping class.

版本2.0 中的 System.object 命名空間變更Changes to the System.Uri namespace in Version 2.0
說明在版本 2.0 中對 System.Uri 類別所做的幾個變更,以修正不正確的行為、提高可用性,以及增強安全性。Describes several changes made to the System.Uri class in Version 2.0 to fixed incorrect behavior, enhance usability, and enhance security.

System.Uri 的國際資源識別項支援International Resource Identifier Support in System.Uri
說明在版本 3.5、3.0 SP1 和 2.0 SP1 中的 System.Uri 類別增強功能,以支援國際資源識別項 (IRI) 和國際化網域名稱 (IDN)。Describes enhancements to the System.Uri class in Version 3.5, 3.0 SP1, and 2.0 SP1 for International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support.

3.5 版中的通訊端效能增強功能Socket Performance Enhancements in Version 3.5
說明在版本 3.5、3.0 SP1 和 2.0 SP1 中 System.Net.Sockets.Socket 類別的一組增強功能,其提供另一種非同步模式,可供專業化的高效能通訊端應用程式使用。Describes a set of enhancements to the System.Net.Sockets.Socket class in Version 3.5, 3.0 SP1, and 2.0 SP1 that provide an alternative asynchronous pattern that can be used by specialized high-performance socket applications.

對等名稱解析通訊協定Peer Name Resolution Protocol
說明在版本 3.5 中所新增的支援,以支援對等名稱解析通訊協定 (PNRP)、無伺服器和動態名稱登錄以及名稱解析通訊協定。Describes support added in Version 3.5 to support the Peer Name Resolution Protocol (PNRP), a serverless and dynamic name registration and name resolution protocol. 這些新功能是由 System.Net.PeerToPeer 命名空間所支援。These new features are supported by the System.Net.PeerToPeer namespace.

對等共同作業Peer-to-Peer Collaboration
說明在版本 3.5 中所新增的支援,以支援建置在 PNRP 上的對等協同作業。Describes support added in Version 3.5 to support the Peer-to-Peer Collaboration that builds on PNRP. 這些新功能是由 System.Net.PeerToPeer.Collaboration 命名空間所支援。These new features are supported by the System.Net.PeerToPeer.Collaboration namespace.

3.5 SP1 版中 HttpWebRequest 之 NTLM 驗證的變更Changes to NTLM authentication for HttpWebRequest in Version 3.5 SP1
說明在版本 3.5 SP1 中所做的安全性變更,這些變更會影響 System.Net.HttpWebRequestSystem.Net.HttpListenerSystem.Net.Security.NegotiateStream以及 System.Net 命名空間中的相關類別處理整合式 Windows 驗證的方式。Describes security changes made in Version 3.5 SP1 that affect how integrated Windows authentication is handled by the System.Net.HttpWebRequest, System.Net.HttpListener, System.Net.Security.NegotiateStream, and related classes in the System.Net namespace.

Integrated Windows Authentication with Extended ProtectionIntegrated Windows Authentication with Extended Protection
說明延伸保護的增強功能,這些增強功能會影響 System.Net.HttpWebRequestSystem.Net.HttpListenerSystem.Net.Mail.SmtpClientSystem.Net.Security.SslStreamSystem.Net.Security.NegotiateStream以及 System.Net 和相關命名空間中的相關類別處理整合式 Windows 驗證的方式。Describes enhancements for extended protection that affect how integrated Windows authentication is handled by the System.Net.HttpWebRequest, System.Net.HttpListener, System.Net.Mail.SmtpClient, System.Net.Security.SslStream, System.Net.Security.NegotiateStream, and related classes in the System.Net and related namespaces.

使用 IPv6 和 Teredo 的 NAT 周遊NAT Traversal using IPv6 and Teredo
說明 System.NetSystem.Net.NetworkInformationSystem.Net.Sockets 命名空間所新增的增強功能,以支援使用 IPv6 和 Teredo 進行 NAT 周遊。Describes enhancements added to the System.Net, System.Net.NetworkInformation, and System.Net.Sockets namespaces to support NAT traversal using IPv6 and Teredo.

Windows 市集應用程式的網路隔離Network Isolation for Windows Store Apps
說明在 System.Net System.Net.Http Windows 8.X System.Net.Http.Headers 存放區應用程式中使用、和命名空間中的類別時,網路隔離的影響。Describes the impact of network isolation when classes in the System.Net, System.Net.Http, and System.Net.Http.Headers namespaces are used in Windows 8.x Store apps.

網路程式設計範例Network Programming Samples
可供下載的網路程式設計範例的連結,這些範例會使用 System.NetSystem.Net.CacheSystem.Net.ConfigurationSystem.Net.MailSystem.Net.MimeSystem.Net.NetworkInformationSystem.Net.PeerToPeerSystem.Net.Security以及 System.Net.Sockets 命名空間中的類別。Links to downloadable network programming samples that use classes in the System.Net, System.Net.Cache, System.Net.Configuration, System.Net.Mail, System.Net.Mime, System.Net.NetworkInformation, System.Net.PeerToPeer, System.Net.Security, System.Net.Sockets namespaces.

參考Reference

System.Net
提供一個簡單的程式設計介面,讓現今網路所用的許多通訊協定使用。Provides a simple programming interface for many of the protocols used on networks today. 此命名空間中的 System.Net.WebRequestSystem.Net.WebResponse 類別是可外掛式通訊協定的基礎。The System.Net.WebRequest and System.Net.WebResponse classes in this namespace are the basis for pluggable protocols.

System.Net.Cache
可定義類型和列舉,這些類型和列舉是用來定義使用 System.Net.WebRequestSystem.Net.HttpWebRequest 類別所取得之資源的快取原則。Defines the types and enumerations used to define cache policies for resources obtained using the System.Net.WebRequest and System.Net.HttpWebRequest classes.

System.Net.Configuration
應用程式用來以程式設計方式存取及更新 System.Net 命名空間組態設定的類別。Classes that applications use to programmatically access and update configuration settings for the System.Net namespaces.

System.Net.Http
可為現代 HTTP 應用程式提供程式設計介面的類別。Classes that provides a programming interface for modern HTTP applications.

System.Net.Http.Headers
System.Net.Http 命名空間所使用的 HTTP 標頭集合提供支援Provides support for collections of HTTP headers used by the System.Net.Http namespace

System.Net.Mail
用於使用 SMTP 通訊協定撰寫及傳送郵件的類別。Classes to compose and send mail using the SMTP protocol.

System.Net.Mime
可定義類型,這些類型是用於表示 System.Net.Mail 命名空間中的類別所使用的多用途網際網路郵件交換 (MIME) 標頭。Defines types that are used to represent Multipurpose Internet Mail Exchange (MIME) headers used by classes in the System.Net.Mail namespace.

System.Net.NetworkInformation
以程式設計方式收集網路事件、變更、統計資料和屬性的相關資訊的類別。Classes to programmatically gather information about network events, changes, statistics, and properties.

System.Net.PeerToPeer
為開發人員提供對等名稱解析通訊協定 (PNRP) 的 Managed 實作。Provides a managed implementation of the Peer Name Resolution Protocol (PNRP) for developers.

System.Net.PeerToPeer.Collaboration
為開發人員提供對等協同作業介面的 Managed 實作。Provides a managed implementation of the Peer-to-Peer Collaboration interface for developers.

System.Net.Security
用於提供主機之間安全通訊的網路資料流的類別。Classes to provide network streams for secure communications between hosts.

System.Net.Sockets
提供 Windows Sockets (Winsock) 介面的 Managed 實作,讓需要協助控制網路存取的開發人員使用。Provides a managed implementation of the Windows Sockets (Winsock) interface for developers who need to help control access to the network.

System.Net.WebSockets
為開發人員提供 WebSocket 介面的 Managed 實作。Provides a managed implementation of the WebSocket interface for developers.

System.Uri
提供以物件表示屬性的統一資源識別碼 (URI),而且可以輕鬆存取 URI 的部分。Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.

System.Security.Authentication.ExtendedProtection
為應用程式提供使用延伸保護進行驗證的支援。Provides support for authentication using extended protection for applications.

System.Security.Authentication.ExtendedProtection.Configuration
為應用程式提供使用延伸保護設定驗證組態的支援。Provides support for configuration of authentication using extended protection for applications.

另請參閱See also