.NET API Reference

Welcome to the .NET API reference documentation. Explore the namespaces and types below to find information on classes, methods, properties, and more.

System
System.Collections
System.IO
System.Linq

Classes

System.Text
System.Net
System.Threading

Object Class

Namespace: System

The root of all types in the .NET Framework. Provides instance members that are available to all other types.

Public Methods

ToString()

string ToString()

Returns a string that represents the current object.

Equals(object obj)

bool Equals(object obj)

Determines whether the specified object is equal to the current object.

GetHashCode()

int GetHashCode()

Serves as the default hash function.

String Class

Namespace: System

Represents text as a sequence of characters. Strings are immutable.

Public Methods

IsNullOrEmpty(string value)

static bool IsNullOrEmpty(string value)

Indicates whether the specified string is null or an empty string ("").

Contains(string value)

bool Contains(string value)

Returns a value indicating whether the specified System.String occurs within this string.

Replace(char oldChar, char newChar)

string Replace(char oldChar, char newChar)

Returns a new string in which all occurrences of a specified character in this instance are replaced with another specified character.

Int32 Struct

Namespace: System

Represents a 32-bit signed integer.

Public Methods

Parse(string s)

static int Parse(string s)

Converts the string representation of a number to its 32-bit signed integer equivalent.

Boolean Struct

Namespace: System

Represents a Boolean value (true or false).

DateTime Struct

Namespace: System

Represents an instance in time, typically expressed as a date and time of day.

Public Properties

Now

static DateTime Now { get; }

Gets a System.DateTime object that is set to the current date and time on this computer, expressed as the local time.

Exception Class

Namespace: System

Represents errors that occur during execution.

Public Properties

Message

string Message { get; }

Gets the message that describes the current exception.

ArrayList Class

Namespace: System.Collections

Represents a non-generic collection of objects that can be individually accessed by index.

List<T> Class

Namespace: System.Collections.Generic

Represents a strongly typed list of objects that can be accessed by index. Provides methods for manipulating lists by adding, removing, searching, and sorting elements.

Public Methods

Add(T item)

void Add(T item)

Adds an object to the end of the System.Collections.Generic.List<T>.

Remove(T item)

bool Remove(T item)

Removes the first occurrence of a specific object from the System.Collections.Generic.List<T>.

Dictionary<TKey, TValue> Class

Namespace: System.Collections.Generic

Represents a collection of key/value pairs that are organized by key.

Public Methods

Add(TKey key, TValue value)

void Add(TKey key, TValue value)

Adds an element with the specified key and value to the dictionary.

ContainsKey(TKey key)

bool ContainsKey(TKey key)

Determines whether the dictionary contains an element with the specified key.

File Class

Namespace: System.IO

Provides static methods for the creation, copying, deletion, moving, and opening of single files, and aids in their creation, deletion, and opening by System.IO.FileStream objects.

Public Methods

Exists(string path)

static bool Exists(string path)

Determines whether the specified file exists.

ReadAllText(string path)

static string ReadAllText(string path)

Opens a text file, reads all lines of the file, and then closes the file.

WriteAllText(string path, string contents)

static void WriteAllText(string path, string contents)

Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.

Directory Class

Namespace: System.IO

Provides static methods for the creation, moving, and enumeration of directories and subdirectories.

Public Methods

Exists(string path)

static bool Exists(string path)

Determines whether the given path refers to an existing directory on disk.

CreateDirectory(string path)

static DirectoryInfo CreateDirectory(string path)

Creates all the directories and subdirectories in the specified path unless they already exist.

StreamReader Class

Namespace: System.IO

Implements a System.IO.TextReader that reads characters from a byte stream in a particular encoding.

StreamWriter Class

Namespace: System.IO

Implements a System.IO.TextWriter for writing characters to a stream in a particular encoding.

Enumerable Class

Namespace: System.Linq

Provides extension methods for querying collections.

Public Methods

Where<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate)

static IEnumerable<TSource> Where<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate)

Filters a sequence of values based on a predicate.

Select<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> selector)

static IEnumerable<TResult> Select<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> selector)

Projects each element of a sequence into a new form.

StringBuilder Class

Namespace: System.Text

Represents a mutable sequence of characters.

Public Methods

Append(string value)

StringBuilder Append(string value)

Appends the string representation of the specified string to this instance.

ToString()

string ToString()

Converts to a System.String the sequence of characters in the current System.Text.StringBuilder.

Encoding Class

Namespace: System.Text

Represents a character encoding.

Public Properties

UTF8

static Encoding UTF8 { get; }

Gets a System.Text.Encoding object that supports the UTF-8 code page.

IPAddress Class

Namespace: System.Net

Represents an Internet Protocol (IP) address.

EndPoint Class

Namespace: System.Net

Provides a base class for network endpoint classes.

HttpWebRequest Class

Namespace: System.Net

Sends an HTTP request to a Uniform Resource Identifier (URI) resource and receives a response from the resource.

WebClient Class

Namespace: System.Net

An object that sends data requests to and receives responses from a resource identified by a URI.

Public Methods

DownloadString(string address)

string DownloadString(string address)

Downloads the resource with the specified URI to a local string.

Thread Class

Namespace: System.Threading

Represents an instance of a managed execution thread.

Public Methods

Sleep(int millisecondsTimeout)

static void Sleep(int millisecondsTimeout)

Suspends the current thread for the specified number of milliseconds.

CancellationTokenSource Class

Namespace: System.Threading

Propagates a notification that operations should be canceled.

Public Methods

Cancel()

void Cancel()

Notifies all waiting threads that the cancellation has been requested.