C# Класс Tp.Utils.Html.Encoder

White-list principle HTML entity encoder.
Unlike HttpUtility, provides stronger and more secure encoding where all characters except English alphabet letters will be encoded as HTML entities.
Показать файл Открыть проект

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

Метод Описание
HtmlAttributeEncode ( string input ) : string

Encodes the specified input string for use in HTML tag attributes.

HtmlAttributeEncode ( TextReader input, TextWriter output ) : void

Encodes the specified input string for use in HTML tag attributes.

HtmlAttributeEncode ( string input, TextWriter output ) : void

Encodes the specified input string for use in HTML tag attributes.

HtmlEncode ( this input ) : string

Encodes the specified input string for use in HTML.

This method is null safe.

HtmlEncode ( TextReader input, TextWriter output ) : void

Reads text from the specified input and writes encoded text for use in HTML to the specified output.

HtmlEncode ( string input, TextWriter output ) : void

Encodes the specified input and writes encoded text for use in HTML to the specified output.

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

Метод Описание
HtmlAttributeEncode ( int ch, TextWriter output ) : void
HtmlEncode ( int ch, StringBuilder builder ) : void

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

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

Encodes the specified input string for use in HTML tag attributes.
public static HtmlAttributeEncode ( string input ) : string
input string /// The string to encode, may be null. ///
Результат string

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

Encodes the specified input string for use in HTML tag attributes.
/// If is null. /// /// If is null. ///
public static HtmlAttributeEncode ( TextReader input, TextWriter output ) : void
input TextReader /// Input stream containing text to encode. ///
output System.IO.TextWriter /// Output stream where to write encoded text. ///
Результат void

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

Encodes the specified input string for use in HTML tag attributes.
/// If is null. ///
public static HtmlAttributeEncode ( string input, TextWriter output ) : void
input string /// The string to encode, may be null. ///
output System.IO.TextWriter /// Output stream where to write encoded text. ///
Результат void

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

Encodes the specified input string for use in HTML.
This method is null safe.
public static HtmlEncode ( this input ) : string
input this /// The string to encode, may be null. ///
Результат string

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

Reads text from the specified input and writes encoded text for use in HTML to the specified output.
/// If is null. /// /// If is null. ///
public static HtmlEncode ( TextReader input, TextWriter output ) : void
input TextReader /// Input stream containing text to encode. ///
output System.IO.TextWriter /// Output stream where to write encoded text. ///
Результат void

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

Encodes the specified input and writes encoded text for use in HTML to the specified output.
/// If is null. ///
public static HtmlEncode ( string input, TextWriter output ) : void
input string /// The text to encode, may be null. ///
output System.IO.TextWriter /// Output stream where to write encoded text. ///
Результат void