mscorlib(4.0.0.0) API with additions
System.Net.WebUtility Class Reference

Provides methods for encoding and decoding URLs when processing Web requests. More...

Static Public Member Functions

static string HtmlEncode (string value)
 Converts a string to an HTML-encoded string. More...
 
static unsafe void HtmlEncode (string value, TextWriter output)
 Converts a string into an HTML-encoded string, and returns the output as a T:System.IO.TextWriter stream of output. More...
 
static string HtmlDecode (string value)
 Converts a string that has been HTML-encoded for HTTP transmission into a decoded string. More...
 
static void HtmlDecode (string value, TextWriter output)
 Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a T:System.IO.TextWriter output stream. More...
 
static string UrlEncode (string value)
 Converts a text string into a URL-encoded string. More...
 
static byte [] UrlEncodeToBytes (byte[] value, int offset, int count)
 Converts a byte array into a URL-encoded byte array. More...
 
static string UrlDecode (string encodedValue)
 Converts a string that has been encoded for transmission in a URL into a decoded string. More...
 
static byte [] UrlDecodeToBytes (byte[] encodedValue, int offset, int count)
 Converts an encoded byte array that has been encoded for transmission in a URL into a decoded byte array. More...
 

Detailed Description

Provides methods for encoding and decoding URLs when processing Web requests.

Definition at line 13 of file WebUtility.cs.

Member Function Documentation

◆ HtmlDecode() [1/2]

static string System.Net.WebUtility.HtmlDecode ( string  value)
static

Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.

Parameters
valueThe string to decode.
Returns
A decoded string.

Definition at line 559 of file WebUtility.cs.

◆ HtmlDecode() [2/2]

static void System.Net.WebUtility.HtmlDecode ( string  value,
TextWriter  output 
)
static

Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a T:System.IO.TextWriter output stream.

Parameters
valueThe string to decode.
outputA T:System.IO.TextWriter stream of output.
Exceptions
T:System.ArgumentNullExceptionThe output parameter cannot be null if the value parameter is not null.

Definition at line 578 of file WebUtility.cs.

◆ HtmlEncode() [1/2]

static string System.Net.WebUtility.HtmlEncode ( string  value)
static

Converts a string to an HTML-encoded string.

Parameters
valueThe string to encode.
Returns
An encoded string.

Definition at line 446 of file WebUtility.cs.

◆ HtmlEncode() [2/2]

static unsafe void System.Net.WebUtility.HtmlEncode ( string  value,
TextWriter  output 
)
static

Converts a string into an HTML-encoded string, and returns the output as a T:System.IO.TextWriter stream of output.

Parameters
valueThe string to encode.
outputA T:System.IO.TextWriter output stream.
Exceptions
T:System.ArgumentNullExceptionThe output parameter cannot be null if the value parameter is not null.

Definition at line 466 of file WebUtility.cs.

◆ UrlDecode()

static string System.Net.WebUtility.UrlDecode ( string  encodedValue)
static

Converts a string that has been encoded for transmission in a URL into a decoded string.

Parameters
encodedValueA URL-encoded string to decode.
Returns
Returns T:System.String.A decoded string.

Definition at line 877 of file WebUtility.cs.

◆ UrlDecodeToBytes()

static byte [] System.Net.WebUtility.UrlDecodeToBytes ( byte []  encodedValue,
int  offset,
int  count 
)
static

Converts an encoded byte array that has been encoded for transmission in a URL into a decoded byte array.

Parameters
encodedValueA URL-encoded T:System.Byte array to decode.
offsetThe offset, in bytes, from the start of the T:System.Byte array to decode.
countThe count, in bytes, to decode from the T:System.Byte array.
Returns
Returns T:System.Byte.A decoded T:System.Byte array.

Definition at line 892 of file WebUtility.cs.

◆ UrlEncode()

static string System.Net.WebUtility.UrlEncode ( string  value)
static

Converts a text string into a URL-encoded string.

Parameters
valueThe text to URL-encode.
Returns
Returns T:System.String.A URL-encoded string.

Definition at line 768 of file WebUtility.cs.

◆ UrlEncodeToBytes()

static byte [] System.Net.WebUtility.UrlEncodeToBytes ( byte []  value,
int  offset,
int  count 
)
static

Converts a byte array into a URL-encoded byte array.

Parameters
valueThe T:System.Byte array to URL-encode.
offsetThe offset, in bytes, from the start of the T:System.Byte array to encode.
countThe count, in bytes, to encode from the T:System.Byte array.
Returns
Returns T:System.Byte.An encoded T:System.Byte array.

Definition at line 784 of file WebUtility.cs.


The documentation for this class was generated from the following file: