Share via


HttpUtility.HtmlAttributeEncode 메서드

정의

적어도 문자열을 HTML 인코딩 문자열로 변환합니다.

오버로드

HtmlAttributeEncode(String)

적어도 문자열 하나를 HTML로 인코딩된 문자열로 변환합니다.

HtmlAttributeEncode(String, TextWriter)

최소한 문자열을 HTML로 인코딩된 문자열로 변환하고 인코딩된 문자열을 TextWriter 출력 스트림으로 보냅니다.

HtmlAttributeEncode(String)

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

적어도 문자열 하나를 HTML로 인코딩된 문자열로 변환합니다.

public:
 static System::String ^ HtmlAttributeEncode(System::String ^ s);
public static string? HtmlAttributeEncode (string? s);
public static string HtmlAttributeEncode (string s);
static member HtmlAttributeEncode : string -> string
Public Shared Function HtmlAttributeEncode (s As String) As String

매개 변수

s
String

인코딩할 문자열입니다.

반환

인코딩된 문자열입니다.

설명

메서드는 HtmlAttributeEncode HTML 특성 값에 삽입에 적합한 문자를 인코딩합니다.

메서드의 HtmlAttributeEncode 문자열 결과는 큰따옴표가 붙은 특성에만 사용해야 합니다. 단일 따옴표로 묶인 특성이 있는 메서드를 HtmlAttributeEncode 사용할 때 보안 문제가 발생할 수 있습니다.

추가 정보

적용 대상

HtmlAttributeEncode(String, TextWriter)

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

최소한 문자열을 HTML로 인코딩된 문자열로 변환하고 인코딩된 문자열을 TextWriter 출력 스트림으로 보냅니다.

public:
 static void HtmlAttributeEncode(System::String ^ s, System::IO::TextWriter ^ output);
public static void HtmlAttributeEncode (string? s, System.IO.TextWriter output);
public static void HtmlAttributeEncode (string s, System.IO.TextWriter output);
static member HtmlAttributeEncode : string * System.IO.TextWriter -> unit
Public Shared Sub HtmlAttributeEncode (s As String, output As TextWriter)

매개 변수

s
String

인코딩할 문자열입니다.

output
TextWriter

TextWriter 출력 스트림입니다.

설명

메서드는 HtmlAttributeEncode 큰따옴표("), 작은따옴표('), 앰퍼샌드(&) 및 왼쪽 꺾쇠 괄호(<)만 해당하는 문자 엔터티로 변환합니다. 메서드보다 HtmlEncode 훨씬 빠릅니다.

메서드의 HtmlAttributeEncode 문자열 결과는 큰따옴표가 붙은 특성에만 사용해야 합니다. 단일 따옴표로 묶인 특성이 있는 메서드를 HtmlAttributeEncode 사용할 때 보안 문제가 발생할 수 있습니다.

추가 정보

적용 대상