編集

次の方法で共有


HttpServerUtilityBase.HtmlEncode Method

Definition

When overridden in a derived class, HTML-encodes a string.

Overloads

HtmlEncode(String)

When overridden in a derived class, HTML-encodes a string and returns the encoded string.

HtmlEncode(String, TextWriter)

When overridden in a derived class, HTML-encodes a string and sends the resulting output to an output stream.

HtmlEncode(String)

When overridden in a derived class, HTML-encodes a string and returns the encoded string.

public:
 virtual System::String ^ HtmlEncode(System::String ^ s);
public virtual string HtmlEncode (string s);
abstract member HtmlEncode : string -> string
override this.HtmlEncode : string -> string
Public Overridable Function HtmlEncode (s As String) As String

Parameters

s
String

The string to encode.

Returns

The HTML-encoded text.

Exceptions

Applies to

HtmlEncode(String, TextWriter)

When overridden in a derived class, HTML-encodes a string and sends the resulting output to an output stream.

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

Parameters

s
String

The string to encode.

output
TextWriter

The stream to contain the encoded string.

Exceptions

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