C# Class Microsoft.Framework.WebEncoders.EncoderExtensions

Helpful extension methods for the encoder classes.
Afficher le fichier Open project: lodejard/AllNetCore Class Usage Examples

Méthodes publiques

Méthode Description
HtmlEncode ( IHtmlEncoder htmlEncoder, string value, TextWriter output ) : void

HTML-encodes a string and writes the result to the supplied output.

The encoded value is also safe for inclusion inside an HTML attribute as long as the attribute value is surrounded by single or double quotes.

JavaScriptStringEncode ( IJavaScriptStringEncoder javaScriptStringEncoder, string value, TextWriter output ) : void

JavaScript-escapes a string and writes the result to the supplied output.

UrlEncode ( IUrlEncoder urlEncoder, string value, TextWriter output ) : void

URL-encodes a string and writes the result to the supplied output.

The encoded value is safe for use in the segment, query, or fragment portion of a URI.

Method Details

HtmlEncode() public static méthode

HTML-encodes a string and writes the result to the supplied output.
The encoded value is also safe for inclusion inside an HTML attribute as long as the attribute value is surrounded by single or double quotes.
public static HtmlEncode ( IHtmlEncoder htmlEncoder, string value, TextWriter output ) : void
htmlEncoder IHtmlEncoder
value string
output TextWriter
Résultat void

JavaScriptStringEncode() public static méthode

JavaScript-escapes a string and writes the result to the supplied output.
public static JavaScriptStringEncode ( IJavaScriptStringEncoder javaScriptStringEncoder, string value, TextWriter output ) : void
javaScriptStringEncoder IJavaScriptStringEncoder
value string
output TextWriter
Résultat void

UrlEncode() public static méthode

URL-encodes a string and writes the result to the supplied output.
The encoded value is safe for use in the segment, query, or fragment portion of a URI.
public static UrlEncode ( IUrlEncoder urlEncoder, string value, TextWriter output ) : void
urlEncoder IUrlEncoder
value string
output TextWriter
Résultat void