Editar

Compartir a través de


HttpServerUtilityBase.UrlEncode Method

Definition

When overridden in a derived class, encodes a string to include only characters that are valid in a URL.

Overloads

UrlEncode(String)

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

UrlEncode(String, TextWriter)

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

UrlEncode(String)

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

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

Parameters

s
String

The text to URL-encode.

Returns

The URL-encoded text.

Exceptions

Applies to

UrlEncode(String, TextWriter)

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

public:
 virtual void UrlEncode(System::String ^ s, System::IO::TextWriter ^ output);
public virtual void UrlEncode (string s, System.IO.TextWriter output);
abstract member UrlEncode : string * System.IO.TextWriter -> unit
override this.UrlEncode : string * System.IO.TextWriter -> unit
Public Overridable Sub UrlEncode (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 UrlEncode 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 UrlEncode.

Applies to