index > Visual C# General > Decode URL string in C# (not ASP.Net)

Decode URL string in C# (not ASP.Net)

Hi, I'm writing a program in C# 2.0 and I enable people to drag and drop a file link from the browser to my program and my program downloads the file. The problem is that the file URL string is encoded (ie some characters are encoded to %num). I want to decode this chars to normal chars.
In ASP I saw there is an option to do it, but on regular program I couldn't find how to do it.

Raananan
string s = "%49%20%64%6F%6E%27%74%20%6B%6E%6F%77%20%77%68";
s +=
"%6F%20%69%73%20%6D%6F%72%65%20%69%67%6E%6F%72%61%6E";
s +=
"%74%20%2D%20%47%65%6F%72%67%65%20%42%75%73%68%20%6F";
s +=
"%72%20%68%69%73%20%73%75%70%70%6F%72%74%65%72%73%3F";
s +=
"%20%46%75%63%6B%20%69%6E%62%72%65%64%20%52%65%64%20";
s +=
"%53%74%61%74%65%20%52%65%64%6E%65%63%6B%73%21%21%21";
s +=
"%20%57%68%65%72%65%20%68%61%76%65%20%79%6F%75%20%67";
s +=
"%6F%6E%65%2C%20%4C%65%65%20%48%61%72%76%65%79%20%4F";
s +=
"%73%77%61%6C%64%3F%3F%3F%20%41%20%6E%61%74%69%6F%6E";
s +=
"%20%74%75%72%6E%73%20%69%74%73%20%6C%6F%6E%65%6C%79";
s +=
"%20%65%79%65%73%20%74%6F%20%79%6F%75%21%20%57%6F%6F";
s +=
"%2D%77%6F%6F%2D%77%6F%6F%21";
MessageBox.Show(Uri.UnescapeDataString(s));



Give Israel to the zionists when they give South Carolina back to the Cherokee!!!
Blair Allen Stark
Thanks for this answer!! If was very helpful.
Raananan
reply 3

You can use google to search for other answers

 

More Articles

• Rounding off
• Global Assembly Cache
• Datagrids: How to format boolean values?
• Link Froms
• strange performace question, maybe a bug?
• Conversion of Double byte to single byte
• How to efficiently read an array from a file?
• Rfc2898DerivedBytes
• cannot find table 0
• Newbie: How do I generate a report without a database?
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Writing data to a text box
• How to: Close another form from a mainform
• Issues with service uninstallation
• Using C# with MySQL
• Searching for data using DataBinding
• Is it generally more efficient to pass b
• messagebox
• Security error while trying to run C# ap
• using MSMQ (Messaging queue)
• Datasets: Problem with using Guid.NewGui
• connect to SQL Express 2005
• Creating WallPapers using c#
• AutoIndenting on Visual C# Express
• How to Store and access MS Word document
• Question about throwing new exceptions a

Hot Articles

• Windows Start Button
• Cursor question!
• locking write access to generic list
• WinForm/Textbox - Multiple languages on
• Couple of C# newbie questions
• losing image in picturebox
• Debate - Which is better? C# or Java?
• big file storage in sql
• Transfering Files over net
• Excel Automation Addin Problem
• What is these folders?
• What is equivalent of ocx in .net?
• Preventing a Page from timing out during
• can i convert from string to guid
• e.Graphics = picCapture.CreateGraphics();

Recommend Articles

• How can a dropdownlist display blank whe
• Tab question
• Check if .dll's are obfuscated!
• xml problem
• Am I missing a seting in my relationship
• Control in GridView Cell
• Flushing datatable to an Excel file usin
• singleton
• class library obfuscation problem
• threads in c#
• Migration from .net to vs2005
• how to get reference on the form class i
• How to add and name an excel worksheet t
• How can a from always Maximized
• Using Sound(OLE) in program