NetAssembly Documentation - System.Net

System.Net Overview

The System.Net namespace in .NET provides core classes and functions for interacting with network connections, including HTTP, HTTPS, TCP/IP, and more. It simplifies network operations, making them easier to use and more reliable.

Key classes include:

Key Features

Example: Basic Network Connection

Here's a simple example of creating a network connection:

                
                using System;

                public class Example {
                    public static void Main(string[] args) {
                        // Create a network connection
                        NetworkConnection connection = new NetworkConnection("localhost", 8080);

                        // Send a request
                        connection.Send("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n");

                        // Receive the response
                        string response = connection.Receive();
                        Console.WriteLine(response);
                    }
                }
            

Related Concepts

  • IPAddress: Represents a unique network address.
  • HTTP: The protocol for transferring data over the internet.
  • HTTPS: A secure version of HTTP.