HttpServerUtility.UrlDecode Method
This page is specific to:.NET Framework Version:1.12.03.03.54.0
.NET Framework Class Library
HttpServerUtility.UrlDecode Method

Decodes a string encoded for HTTP transmission and sent to the server in a URL.

Overload List

URL-decodes a string and returns the decoded string.

[Visual Basic] Overloads Public Function UrlDecode(String) As String
[C#] public string UrlDecode(string);
[C++] public: String* UrlDecode(String*);
[JScript] public function UrlDecode(String) : String;

Decodes an HTML string received in a URL and sends the resulting output to a TextWriter output stream.

[Visual Basic] Overloads Public Sub UrlDecode(String, TextWriter)
[C#] public void UrlDecode(string, TextWriter);
[C++] public: void UrlDecode(String*, TextWriter*);
[JScript] public function UrlDecode(String, TextWriter);

Example

The following example decodes the string named EncodedString (received in a URL) into the string named DecodedString.

[Visual Basic] 
Dim writer As New StringWriter
Server.UrlDecode(EncodedString, writer)
Dim DecodedString As String = writer.ToString()
   

[C#] 
StringWriter writer = new StringWriter();
Server.UrlDecode(EncodedString, writer);
String DecodedString = writer.ToString();
   

[C++] 
StringWriter* writer = new StringWriter();
Server->UrlDecode(EncodedString, writer);
String* DecodedString = writer->ToString();
   

[JScript] 
var writer : StringWriter = new StringWriter()
Server.UrlDecode(encodedString, writer)
var decodedString : String = writer.ToString()
   

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View