S
serious-sam
Hello all,
I'm using the System.Uri class to clean up some the URLs we're
passing around, e.g. compacting http://hostname//somefolder//somefile
to http://hostname/somefolder/somefile.
The documentation clearly states that the Uri constructor takes care
of this: http://msdn2.microsoft.com/en-us/library/system.uri.aspx
This works fine on my machine. However, when I try this on our
server box (Win 2003), I just get back the string I passed to the
constructor.
I've checked the .NET versions and the assembly versions on both the
target machine and my workstation. They match.
Here's the code:
using System;
namespace sandpit
{
class Program
{
public static void Main(string[] args)
{
Type type = typeof(Uri);
Console.WriteLine(type.ToString());
Console.WriteLine(type.Assembly);
Console.WriteLine(type.AssemblyQualifiedName);
Console.WriteLine(type.UnderlyingSystemType);
Uri uri = new Uri(args.Length == 0 ? "http://hostname///
somefile.txt" : args[0]);
Console.WriteLine(uri.ToString());
}
}
}
Can someone suggest what might be happening here? I'm a little
puzzled.
Cheers,
Misha
I'm using the System.Uri class to clean up some the URLs we're
passing around, e.g. compacting http://hostname//somefolder//somefile
to http://hostname/somefolder/somefile.
The documentation clearly states that the Uri constructor takes care
of this: http://msdn2.microsoft.com/en-us/library/system.uri.aspx
This works fine on my machine. However, when I try this on our
server box (Win 2003), I just get back the string I passed to the
constructor.
I've checked the .NET versions and the assembly versions on both the
target machine and my workstation. They match.
Here's the code:
using System;
namespace sandpit
{
class Program
{
public static void Main(string[] args)
{
Type type = typeof(Uri);
Console.WriteLine(type.ToString());
Console.WriteLine(type.Assembly);
Console.WriteLine(type.AssemblyQualifiedName);
Console.WriteLine(type.UnderlyingSystemType);
Uri uri = new Uri(args.Length == 0 ? "http://hostname///
somefile.txt" : args[0]);
Console.WriteLine(uri.ToString());
}
}
}
Can someone suggest what might be happening here? I'm a little
puzzled.
Cheers,
Misha