System.Net supports a high-level API for working with common Internet
protocols (HTTP being the principal example) without having to deal with
low-level details (such as the actual protocol format). In addition, this
namespace provides some high-level constructs for working with
networks — TCP/IP in particular.
Most C# programmers will work with either the
type, which provides the most high-level view of doing HTTP-style
request/response communications over a TCP/IP network (such as the
Internet), or else the slightly lower-level
WebResponse types. The choice between the two is
really not all that difficult—for most high-level, protocol-agnostic
WebClient will likely be the preferred choice.
If protocol-specific actions need to be taken (such as specifying additional
headers as part of an HTTP request, for example), then likely the C#
programmer will want to work with
WebResponse. To be specific, the C# programmer will
work with the concrete derived types
As shipped, the .NET Framework Class Library provides implementations for three
URI protocol schemes: HTTP, HTTPS, and files (http:, https: and file:,
respectively). For support of other URI types (such as FTP, NNTP, or
POP3), a new derivative of
WebResponse must be written, an Abstract Factory type
IWebRequestCreate interface must be created, and an instance of it (along with the protocol ...