HttpServerUtilityWrapper.HtmlEncode 方法

定義

將字串編碼以顯示於瀏覽器。

多載

HtmlEncode(String)

將字串作 HTML 編碼,並傳回編碼的字串。

HtmlEncode(String, TextWriter)

將字串進行 HTML 編碼,並將產生的輸出傳送至輸出資料流。

HtmlEncode(String)

將字串作 HTML 編碼,並傳回編碼的字串。

public:
 override System::String ^ HtmlEncode(System::String ^ s);
public override string HtmlEncode (string s);
override this.HtmlEncode : string -> string
Public Overrides Function HtmlEncode (s As String) As String

參數

s
String

要編碼的字串。

傳回

HTML 編碼的文字。

適用於

HtmlEncode(String, TextWriter)

將字串進行 HTML 編碼,並將產生的輸出傳送至輸出資料流。

public:
 override void HtmlEncode(System::String ^ s, System::IO::TextWriter ^ output);
public override void HtmlEncode (string s, System.IO.TextWriter output);
override this.HtmlEncode : string * System.IO.TextWriter -> unit
Public Overrides Sub HtmlEncode (s As String, output As TextWriter)

參數

s
String

要編碼的字串。

output
TextWriter

要包含編碼字串的資料流。

備註

參數 output 會透過方法的 HtmlEncode 參考傳遞。 若要在方法完成之後從處理常式擷取輸出,您可以使用 物件的屬性和方法 output 。 如需範例,請參閱 HtmlEncode

適用於