System.Net Namespace

Provides classes for network programming.

Namespace Overview

The System.Net namespace is the foundation for network communication in the .NET Framework. It provides a rich set of classes that enable developers to build a wide variety of network-aware applications, from simple client-server communication to complex web services.

Key functionalities include:

  • Working with IP addresses and network endpoints.
  • Making HTTP requests and handling responses.
  • Managing network protocols like TCP and UDP.
  • Resolving domain names to IP addresses.
  • Handling network authentication and security.

This namespace contains classes for both low-level network socket programming and higher-level abstractions for common network tasks.

Classes

Type Definitions

Class IPAddress

Represents an Internet Protocol (IP) address.

public abstract class IPAddress

This class provides methods for manipulating IP addresses, including IPv4 and IPv6 representations.

Members:

Class IPEndPoint

Represents a network endpoint as an IP address and a port number.

public sealed class IPEndPoint : EndPoint

Used to represent a network address for sockets.

Members:

Class Uri

Represents a Uniform Resource Identifier (URI) and provides properties and methods for parsing, manipulating, and resolving URIs.

public abstract class Uri

Provides a way to work with URIs in a standardized manner.

Members:

Class HttpClient

Sends HTTP requests and receives responses from a resource identified by a URI.

public class HttpClient : IDisposable

This is the primary class for making HTTP requests in modern .NET. It supports asynchronous operations for better performance.

Members:

Class TcpClient

Provides client connections for the TCP network service.

public class TcpClient : IDisposable

A simplified interface for using TCP/IP sockets.

Members:

Class UdpClient

Provides support for UDP services.

public class UdpClient : IDisposable

Allows sending and receiving UDP datagrams.

Members:

Class Dns

Provides simple DNS name resolution.

public static class Dns

A utility class for performing DNS lookups.

Members:

Class NetworkCredential

Represents a user's network credentials.

public class NetworkCredential

Used for authentication purposes in network operations.

Members: