Επεξεργασία

Κοινή χρήση μέσω


HttpServerUtilityWrapper.HtmlEncode Method

Definition

Encodes a string to be displayed in a browser.

Overloads

HtmlEncode(String)

HTML-encodes a string and returns the encoded string.

HtmlEncode(String, TextWriter)

HTML-encodes a string and sends the resulting output to an output stream.

HtmlEncode(String)

HTML-encodes a string and returns the encoded string.

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

Parameters

s
String

The string to encode.

Returns

The HTML-encoded text.

Applies to

HtmlEncode(String, TextWriter)

HTML-encodes a string and sends the resulting output to an output stream.

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)

Parameters

s
String

The string to encode.

output
TextWriter

The stream to contain the encoded string.

Remarks

The output parameter is passed by reference to the HtmlEncode method. To retrieve the output from the handler after the method completes, you use the properties and methods of the output object. For an example, see HtmlEncode.

Applies to