class HttpUtility

in global :: System . Web

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


public static string HtmlAttributeEncode( string s )

Minimally converts a string to an HTML-encoded string.

  • s The string to encode.
  • Returns An encoded string.

public static void HtmlAttributeEncode( string s, TextWriter output )

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

  • s The string to encode
  • output A output stream.

public static string HtmlDecode( string s )

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

  • s The string to decode.
  • Returns A decoded string.

public static void HtmlDecode( string s, TextWriter output )

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

  • s The string to decode.
  • output A stream of output.

public static string HtmlEncode( object value )

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

  • value An object.
  • Returns An encoded string.

public static string HtmlEncode( string s )

Converts a string to an HTML-encoded string.

  • s The string to encode.
  • Returns An encoded string.

public static void HtmlEncode( string s, TextWriter output )

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

  • s The string to encode
  • output A output stream.

public static string JavaScriptStringEncode( string value )

Encodes a string.

  • value A string to encode.
  • Returns An encoded string.

public static string JavaScriptStringEncode( string value, bool addDoubleQuotes )

Encodes a string.

  • value A string to encode.
  • addDoubleQuotes A value that indicates whether double quotation marks will be included around the encoded string.
  • Returns An encoded string.

public static NameValueCollection ParseQueryString( string query )

Parses a query string into a using encoding.

  • query The query string to parse.
  • Returns A of query parameters and values.

public static NameValueCollection ParseQueryString( string query, Encoding encoding )

Parses a query string into a using the specified .

  • query The query string to parse.
  • encoding The to use.
  • Returns A of query parameters and values.

public static string UrlDecode( byte[] bytes, int offset, int count, Encoding e )

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.

  • bytes The array of bytes to decode.
  • offset The position in the byte to begin decoding.
  • count The number of bytes to decode.
  • e The object that specifies the decoding scheme.
  • Returns A decoded string.

public static string UrlDecode( byte[] bytes, Encoding e )

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

  • bytes The array of bytes to decode.
  • e The that specifies the decoding scheme.
  • Returns A decoded string.

public static string UrlDecode( string str )

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

  • str The string to decode.
  • Returns A decoded string.

public static string UrlDecode( string str, Encoding e )

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

  • str The string to decode.
  • e The that specifies the decoding scheme.
  • Returns A decoded string.

public static byte[] UrlDecodeToBytes( byte[] bytes )

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

  • bytes The array of bytes to decode.
  • Returns A decoded array of bytes.

public static byte[] UrlDecodeToBytes( byte[] bytes, int offset, int count )

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.

  • bytes The array of bytes to decode.
  • offset The position in the byte array at which to begin decoding.
  • count The number of bytes to decode.
  • Returns A decoded array of bytes.

public static byte[] UrlDecodeToBytes( string str )

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

  • str The string to decode.
  • Returns A decoded array of bytes.

public static byte[] UrlDecodeToBytes( string str, Encoding e )

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

  • str The string to decode.
  • e The object that specifies the decoding scheme.
  • Returns A decoded array of bytes.

public static string UrlEncode( byte[] bytes )

Converts a byte array into an encoded URL string.

  • bytes The array of bytes to encode.
  • Returns An encoded string.

public static string UrlEncode( byte[] bytes, int offset, int count )

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.

  • bytes The array of bytes to encode.
  • offset The position in the byte array at which to begin encoding.
  • count The number of bytes to encode.
  • Returns An encoded string.

public static string UrlEncode( string str )

Encodes a URL string.

  • str The text to encode.
  • Returns An encoded string.

public static string UrlEncode( string str, Encoding e )

Encodes a URL string using the specified encoding object.

  • str The text to encode.
  • e The object that specifies the encoding scheme.
  • Returns An encoded string.

public static byte[] UrlEncodeToBytes( byte[] bytes )

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

  • bytes The array of bytes to encode.
  • Returns An encoded array of bytes.

public static byte[] UrlEncodeToBytes( byte[] bytes, int offset, int count )

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.

  • bytes The array of bytes to encode.
  • offset The position in the byte array at which to begin encoding.
  • count The number of bytes to encode.
  • Returns An encoded array of bytes.

public static byte[] UrlEncodeToBytes( string str )

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

  • str The string to encode.
  • Returns An encoded array of bytes.

public static byte[] UrlEncodeToBytes( string str, Encoding e )

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

  • str The string to encode
  • e The that specifies the encoding scheme.
  • Returns An encoded array of bytes.

public static string UrlEncodeUnicode( string str )

Converts a string into a Unicode string.

  • str The string to convert.
  • Returns A Unicode string in % notation.

public static byte[] UrlEncodeUnicodeToBytes( string str )

Converts a Unicode string into an array of bytes.

  • str The string to convert.
  • Returns A byte array.

public static string UrlPathEncode( string str )

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

  • str The text to encode.
  • Returns The encoded text.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public HttpUtility( )

😔 No documentation found.