C# 클래스 Microsoft.Framework.WebEncoders.EncoderExtensions

Helpful extension methods for the encoder classes.
파일 보기 프로젝트 열기: lodejard/AllNetCore 1 사용 예제들

공개 메소드들

메소드 설명
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