class HttpUtility
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.
sThe 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.
sThe string to encodeoutputA output stream.
public static string HtmlDecode( string s )
Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
sThe 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.
sThe string to decode.outputA 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.
valueAn object.- Returns An encoded string.
public static string HtmlEncode( string s )
Converts a string to an HTML-encoded string.
sThe 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.
sThe string to encodeoutputA output stream.
public static string JavaScriptStringEncode( string value )
Encodes a string.
valueA string to encode.- Returns An encoded string.
public static string JavaScriptStringEncode( string value, bool addDoubleQuotes )
Encodes a string.
valueA string to encode.addDoubleQuotesA 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.
queryThe 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 .
queryThe query string to parse.encodingThe 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.
bytesThe array of bytes to decode.offsetThe position in the byte to begin decoding.countThe number of bytes to decode.eThe 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.
bytesThe array of bytes to decode.eThe 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.
strThe 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.
strThe string to decode.eThe 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.
bytesThe 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.
bytesThe array of bytes to decode.offsetThe position in the byte array at which to begin decoding.countThe 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.
strThe 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.
strThe string to decode.eThe 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.
bytesThe 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.
bytesThe array of bytes to encode.offsetThe position in the byte array at which to begin encoding.countThe number of bytes to encode.- Returns An encoded string.
public static string UrlEncode( string str )
Encodes a URL string.
strThe text to encode.- Returns An encoded string.
public static string UrlEncode( string str, Encoding e )
Encodes a URL string using the specified encoding object.
strThe text to encode.eThe 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.
bytesThe 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.
bytesThe array of bytes to encode.offsetThe position in the byte array at which to begin encoding.countThe 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.
strThe 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.
strThe string to encodeeThe that specifies the encoding scheme.- Returns An encoded array of bytes.
public static string UrlEncodeUnicode( string str )
Converts a string into a Unicode string.
strThe string to convert.- Returns A Unicode string in % notation.
public static byte[] UrlEncodeUnicodeToBytes( string str )
Converts a Unicode string into an array of bytes.
strThe string to convert.- Returns A byte array.
public static string UrlPathEncode( string str )
Do not use; intended only for browser compatibility. Use .
strThe 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.