C# Класс Ushahidi.Common.Net.HttpUtility

Provides methods for encoding and decoding URLs when processing Web requests. This class cannot be inherited.
Показать файл Открыть проект

Открытые методы

Метод Описание
HtmlDecode ( string s ) : string

Minimally converts a string to an HTML-encoded string.

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

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

HtmlDecode ( string s, TextWriter output ) : void

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

UrlDecode ( byte bytes, Encoding e ) : string

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

UrlDecode ( byte bytes, int offset, int count, Encoding e ) : string

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.

UrlDecode ( string str ) : string

Parses a query string into a using encoding.

Parses a query string into a using the specified .

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

UrlDecode ( string str, Encoding e ) : string

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

UrlDecodeToBytes ( byte bytes ) : byte[]

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

UrlDecodeToBytes ( byte bytes, int offset, int count ) : byte[]

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.

UrlDecodeToBytes ( string str ) : byte[]

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

UrlDecodeToBytes ( string str, Encoding e ) : byte[]

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

UrlEncode ( byte bytes ) : string

Converts a byte array into an encoded URL string.

UrlEncode ( byte bytes, int offset, int count ) : string

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.

UrlEncode ( string str ) : string

Encodes a URL string.

UrlEncode ( string str, Encoding e ) : string

Encodes a URL string using the specified encoding object.

UrlEncodeToBytes ( byte bytes ) : byte[]

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

UrlEncodeToBytes ( byte bytes, int offset, int count ) : byte[]

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.

UrlEncodeToBytes ( string str ) : byte[]

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

UrlEncodeToBytes ( string str, Encoding e ) : byte[]

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

UrlEncodeUnicode ( string str ) : string

Converts a string into a Unicode string.

UrlEncodeUnicodeToBytes ( string str ) : byte[]

Converts a Unicode string into an array of bytes.

UrlPathEncode ( string str ) : string

Encodes the path portion of a URL string for reliable HTTP transmission from the Web server to a client.

Приватные методы

Метод Описание
ASCIIGetString ( byte bytes ) : string

Decodes all the bytes in the specified byte array into a string.

Replace the method "System.Text.Encoding.ASCII.GetString(byte[] bytes);" in .Net Framework.

HexToInt ( char h ) : int
IntToHex ( int n ) : char

Converts a string to an HTML-encoded string.

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

IsNonAsciiByte ( byte b ) : bool
IsSafe ( char ch ) : bool
UrlDecodeBytesFromBytesInternal ( byte buf, int offset, int count ) : byte[]
UrlDecodeStringFromBytesInternal ( byte buf, int offset, int count, Encoding e ) : string
UrlDecodeStringFromStringInternal ( string s, Encoding e ) : string
UrlEncodeBytesToBytesInternal ( byte bytes, int offset, int count, bool alwaysCreateReturnValue ) : byte[]
UrlEncodeBytesToBytesInternalNonAscii ( byte bytes, int offset, int count, bool alwaysCreateReturnValue ) : byte[]
UrlEncodeNonAscii ( string str, Encoding e ) : string
UrlEncodeSpaces ( string str ) : string
UrlEncodeUnicodeStringToStringInternal ( string s, bool ignoreAscii ) : string

Описание методов

HtmlDecode() публичный статический Метод

Minimally converts a string to an HTML-encoded string. Minimally converts a string into an HTML-encoded string and sends the encoded string to a output stream. Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
public static HtmlDecode ( string s ) : string
s string The string to encode.
Результат string

HtmlDecode() публичный статический Метод

Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a output stream.
public static HtmlDecode ( string s, TextWriter output ) : void
s string The string to decode.
output System.IO.TextWriter A stream of output.
Результат void

UrlDecode() публичный статический Метод

Converts a URL-encoded byte array into a decoded string using the specified decoding object.
public static UrlDecode ( byte bytes, Encoding e ) : string
bytes byte The array of bytes to decode.
e System.Text.Encoding The that specifies the decoding scheme.
Результат string

UrlDecode() публичный статический Метод

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.
public static UrlDecode ( byte bytes, int offset, int count, Encoding e ) : string
bytes byte The array of bytes to decode.
offset int The position in the byte to begin decoding.
count int The number of bytes to decode.
e System.Text.Encoding The object that specifies the decoding scheme.
Результат string

UrlDecode() публичный статический Метод

Parses a query string into a using encoding. Parses a query string into a using the specified . Converts a string that has been encoded for transmission in a URL into a decoded string.
query is null. query is null.- or -encoding is null.
public static UrlDecode ( string str ) : string
str string The string to decode.
Результат string

UrlDecode() публичный статический Метод

Converts a URL-encoded string into a decoded string, using the specified encoding object.
public static UrlDecode ( string str, Encoding e ) : string
str string The string to decode.
e System.Text.Encoding The that specifies the decoding scheme.
Результат string

UrlDecodeToBytes() публичный статический Метод

Converts a URL-encoded array of bytes into a decoded array of bytes.
public static UrlDecodeToBytes ( byte bytes ) : byte[]
bytes byte The array of bytes to decode.
Результат byte[]

UrlDecodeToBytes() публичный статический Метод

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.
public static UrlDecodeToBytes ( byte bytes, int offset, int count ) : byte[]
bytes byte The array of bytes to decode.
offset int The position in the byte array at which to begin decoding.
count int The number of bytes to decode.
Результат byte[]

UrlDecodeToBytes() публичный статический Метод

Converts a URL-encoded string into a decoded array of bytes.
public static UrlDecodeToBytes ( string str ) : byte[]
str string The string to decode.
Результат byte[]

UrlDecodeToBytes() публичный статический Метод

Converts a URL-encoded string into a decoded array of bytes using the specified decoding object.
public static UrlDecodeToBytes ( string str, Encoding e ) : byte[]
str string The string to decode.
e System.Text.Encoding The object that specifies the decoding scheme.
Результат byte[]

UrlEncode() публичный статический Метод

Converts a byte array into an encoded URL string.
public static UrlEncode ( byte bytes ) : string
bytes byte The array of bytes to encode.
Результат string

UrlEncode() публичный статический Метод

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.
public static UrlEncode ( byte bytes, int offset, int count ) : string
bytes byte The array of bytes to encode.
offset int The position in the byte array at which to begin encoding.
count int The number of bytes to encode.
Результат string

UrlEncode() публичный статический Метод

Encodes a URL string.
public static UrlEncode ( string str ) : string
str string The text to encode.
Результат string

UrlEncode() публичный статический Метод

Encodes a URL string using the specified encoding object.
public static UrlEncode ( string str, Encoding e ) : string
str string The text to encode.
e System.Text.Encoding The object that specifies the encoding scheme.
Результат string

UrlEncodeToBytes() публичный статический Метод

Converts an array of bytes into a URL-encoded array of bytes.
public static UrlEncodeToBytes ( byte bytes ) : byte[]
bytes byte The array of bytes to encode.
Результат byte[]

UrlEncodeToBytes() публичный статический Метод

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.
public static UrlEncodeToBytes ( byte bytes, int offset, int count ) : byte[]
bytes byte The array of bytes to encode.
offset int The position in the byte array at which to begin encoding.
count int The number of bytes to encode.
Результат byte[]

UrlEncodeToBytes() публичный статический Метод

Converts a string into a URL-encoded array of bytes.
public static UrlEncodeToBytes ( string str ) : byte[]
str string The string to encode.
Результат byte[]

UrlEncodeToBytes() публичный статический Метод

Converts a string into a URL-encoded array of bytes using the specified encoding object.
public static UrlEncodeToBytes ( string str, Encoding e ) : byte[]
str string The string to encode
e System.Text.Encoding The that specifies the encoding scheme.
Результат byte[]

UrlEncodeUnicode() публичный статический Метод

Converts a string into a Unicode string.
public static UrlEncodeUnicode ( string str ) : string
str string The string to convert.
Результат string

UrlEncodeUnicodeToBytes() публичный статический Метод

Converts a Unicode string into an array of bytes.
public static UrlEncodeUnicodeToBytes ( string str ) : byte[]
str string The string to convert.
Результат byte[]

UrlPathEncode() публичный статический Метод

Encodes the path portion of a URL string for reliable HTTP transmission from the Web server to a client.
public static UrlPathEncode ( string str ) : string
str string The text to URL-encode.
Результат string