C# Класс Microsoft.Framework.WebEncoders.EncoderExtensions

Helpful extension methods for the encoder classes.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

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

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
Результат void

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

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
Результат void

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

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
Результат void