J
John Hoge
Hi,
I need to UrlDecode a string in a simple console application, but I am
having trouble accessing Server.UrlDecode, even though System.Web is
included. The application pulls a text out of a referring URL string
and (eventually) will run a simple report.
Here is an excerpt of my code:
using System;
using System.Web;
using System.Text.RegularExpressions;
namespace Adsense
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
string test = @"http://pagead2.googlesyndication.co...canoeskayaks.php&color_bg=f5f5f5&color_text=0";
Console.WriteLine (test);
Regex re = new Regex(@"\&url\=([^&]+)&");
Console.WriteLine(Server.UrlDecode(re.Match(test).Groups[1]));
}
}
}
I need to UrlDecode a string in a simple console application, but I am
having trouble accessing Server.UrlDecode, even though System.Web is
included. The application pulls a text out of a referring URL string
and (eventually) will run a simple report.
Here is an excerpt of my code:
using System;
using System.Web;
using System.Text.RegularExpressions;
namespace Adsense
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
string test = @"http://pagead2.googlesyndication.co...canoeskayaks.php&color_bg=f5f5f5&color_text=0";
Console.WriteLine (test);
Regex re = new Regex(@"\&url\=([^&]+)&");
Console.WriteLine(Server.UrlDecode(re.Match(test).Groups[1]));
}
}
}