C# Class 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.
Afficher le fichier Open project: TargetProcess/Target-Process-Plugins

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
HtmlAttributeEncode ( int ch, TextWriter output ) : void
HtmlEncode ( int ch, StringBuilder builder ) : void

Method Details

HtmlAttributeEncode() public static méthode

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. ///
Résultat string

HtmlAttributeEncode() public static méthode

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. ///
Résultat void

HtmlAttributeEncode() public static méthode

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. ///
Résultat void

HtmlEncode() public static méthode

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. ///
Résultat string

HtmlEncode() public static méthode

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. ///
Résultat void

HtmlEncode() public static méthode

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. ///
Résultat void