HttpUtility Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Provides methods for encoding and decoding URLs when processing Web requests. This class cannot be inherited.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

System::Object
  System.Web::HttpUtility

public ref class HttpUtility sealed 

NameDescription
System_CAPS_pubmethodHttpUtility()

Initializes a new instance of the HttpUtility class.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticHtmlAttributeEncode(String^)

Minimally converts a string to an HTML-encoded string.

System_CAPS_pubmethodSystem_CAPS_staticHtmlAttributeEncode(String^, TextWriter^)

Minimally converts a string into an HTML-encoded string and sends the encoded string to a TextWriter output stream.

System_CAPS_pubmethodSystem_CAPS_staticHtmlDecode(String^)

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

System_CAPS_pubmethodSystem_CAPS_staticHtmlDecode(String^, TextWriter^)

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

System_CAPS_pubmethodSystem_CAPS_staticHtmlEncode(Object^)

Converts an object's string representation into an HTML-encoded string, and returns the encoded string.

System_CAPS_pubmethodSystem_CAPS_staticHtmlEncode(String^)

Converts a string to an HTML-encoded string.

System_CAPS_pubmethodSystem_CAPS_staticHtmlEncode(String^, TextWriter^)

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

System_CAPS_pubmethodSystem_CAPS_staticJavaScriptStringEncode(String^)

Encodes a string.

System_CAPS_pubmethodSystem_CAPS_staticJavaScriptStringEncode(String^, Boolean)

Encodes a string.

System_CAPS_pubmethodSystem_CAPS_staticParseQueryString(String^)

Parses a query string into a NameValueCollection using UTF8 encoding.

System_CAPS_pubmethodSystem_CAPS_staticParseQueryString(String^, Encoding^)

Parses a query string into a NameValueCollection using the specified Encoding.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticUrlDecode(array<Byte>^, Encoding^)

Converts a URL-encoded byte array into a decoded string using the specified decoding object.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecode(array<Byte>^, Int32, Int32, Encoding^)

Converts a URL-encoded byte array into a decoded string using the specified encoding object, starting at the specified position in the array, and continuing for the specified number of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecode(String^)

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

System_CAPS_pubmethodSystem_CAPS_staticUrlDecode(String^, Encoding^)

Converts a URL-encoded string into a decoded string, using the specified encoding object.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecodeToBytes(array<Byte>^)

Converts a URL-encoded array of bytes into a decoded array of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecodeToBytes(array<Byte>^, Int32, Int32)

Converts a URL-encoded array of bytes into a decoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecodeToBytes(String^)

Converts a URL-encoded string into a decoded array of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlDecodeToBytes(String^, Encoding^)

Converts a URL-encoded string into a decoded array of bytes using the specified decoding object.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncode(array<Byte>^)

Converts a byte array into an encoded URL string.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncode(array<Byte>^, Int32, Int32)

Converts a byte array into a URL-encoded string, starting at the specified position in the array and continuing for the specified number of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncode(String^)

Encodes a URL string.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncode(String^, Encoding^)

Encodes a URL string using the specified encoding object.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeToBytes(array<Byte>^)

Converts an array of bytes into a URL-encoded array of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeToBytes(array<Byte>^, Int32, Int32)

Converts an array of bytes into a URL-encoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeToBytes(String^)

Converts a string into a URL-encoded array of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeToBytes(String^, Encoding^)

Converts a string into a URL-encoded array of bytes using the specified encoding object.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeUnicode(String^)

Obsolete. Converts a string into a Unicode string.

System_CAPS_pubmethodSystem_CAPS_staticUrlEncodeUnicodeToBytes(String^)

Obsolete. Converts a Unicode string into an array of bytes.

System_CAPS_pubmethodSystem_CAPS_staticUrlPathEncode(String^)

Do not use; intended only for browser compatibility. Use UrlEncode.

The HttpUtility class is used internally by the HttpServerUtility class, whose methods and properties are exposed through the intrinsic ASP.NET Server object. Additionally, the HttpUtility class contains encoding and decoding utility methods that are not accessible from the Server.

To encode or decode values outside of a web application, use the WebUtility class.

The following code example demonstrates the use of the UrlEncode, UrlDecode and ParseQueryString methods of the HttpUtility class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: