Hello Jeroen-bart Engelen,
It's .NET 2.0 bug parsing to string. in 1.1 it works normal
use Console.WriteLine(link.OriginalString)
J> Michael Nemtsev wrote:
J>
>> Hello Jeroen-bart Engelen,
>>
[quoted text clipped - 6 lines]
>> try
>> J> it with the @-sign and it didn't work.
J> using System;
J> using System.Collections.Generic;
J> using System.Text;
J> namespace UriTest
J> {
J> class Program
J> {
J> static void Main(string[] args)
J> {
J> Uri link = new
J> Uri("http://www.google.com/reader/atom/feed/http://www.roadrunnerreco
J> rds.com/blabbermouth.net/newsfeed.xml");
J> Console.WriteLine(link.ToString());
J> }
J> }
J> }
J> The console output shows that the second slash for the second
J> "http://" has been removed, but I need it to be there.
J>
J> Jeroen-bart Engelen
J>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jeroen-bart Engelen - 05 Mar 2006 15:40 GMT
> Hello Jeroen-bart Engelen,
>
> It's .NET 2.0 bug parsing to string. in 1.1 it works normal
>
> use Console.WriteLine(link.OriginalString)
I wouldn't call it a bug (I know I did, but it's not really a bug),
because it's documented to work that way, I just want to know a way
around.
If I can use link.OriginalString that I could just as easily use the
string I used to create the Uri to begin with, but the
WebRequest.Create() fucntion takes a Uri or takes a string and uses
that to create a Uri. Which then mangles my request string.
Jeroen-bart Engelen
Christian Schwendtner - 07 Mar 2006 13:29 GMT
Hi Jeroen-bart Engelen.
Try
Uri link = new
Uri("http://www.google.com/reader/atom/feed/http:/\u2215www.roadrunnerre
cords.com/blabbermouth.net/newsfeed.xml");
hth,
Chris
Jeroen-bart Engelen - 07 Mar 2006 16:09 GMT
> Hi Jeroen-bart Engelen.
>
[quoted text clipped - 3 lines]
> Uri("http://www.google.com/reader/atom/feed/http:/\u2215www.roadrunnerre
> cords.com/blabbermouth.net/newsfeed.xml");
Hey...this seems to work. Cool! Thanks!
Unfortunatly I already P/Invoked the hell out of WinInet to write a
class comparable to HttpWebRequest and wrote a simple Uri class, but
I'm going to check if this fix works all the time. Thanks again!
Jeroen-bart Engelen