[Mono-devel-list] Trouble with HttpWebResponse
Reggie Burnett
rykr at bellsouth.net
Mon Mar 3 14:00:50 EST 2003
What happens? Does it ready anything? Throw an exception?
> -----Original Message-----
> From: mono-devel-list-admin at lists.ximian.com [mailto:mono-devel-list-
> admin at lists.ximian.com] On Behalf Of Peter Magnusson
> Sent: Monday, March 03, 2003 12:54 PM
> To: mono-devel-list at lists.ximian.com
> Subject: [Mono-devel-list] Trouble with HttpWebResponse
>
> At first I thougt I had some trouble with
System.IO.StreamReader.ReadToEnd
> but it seems that there is trouble elsewhere..
> The test described below works fine with Microsoft .NET SDK and the
csc
> compiler but it doesn't work with mono, at least not in SuSE 8.1 Pro.
>
> The failing configurationen uses
> SuSE Linux 8.1 Pro
> Mono-0.21, mcs-0.21
> Compaq Evo N800c (P4 1.7 MHz, 392 MB Ram)
>
> The working configuration uses
> Windows XP Pro SP1
> Visual Studio .NET 2002 Ent. Arc.
> (mono isn't installed in windows)
> Compaq Evo N800c (P4 1.7 MHz, 392 MB Ram)
>
>
> ===== Test Begin ======
> using System;
> using System.IO;
> using System.Text;
> using System.Net;
>
>
> class TestWebResponseStream
> {
> static void Main (string [] args)
> {
> HttpWebRequest myReq =
> (HttpWebRequest)WebRequest.Create("http://www.go-mono.com");
> myReq.UserAgent="Mozilla/4.0 (compatible; monoWebResponseTest)";
> try
> {
> HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
> Stream respStream = myRes.GetResponseStream();
> int respLength=(int)myRes.ContentLength;
>
> StreamReader reader =
> new StreamReader(respStream,
> Encoding.ASCII,true,respLength);
>
> Console.WriteLine("Works to here");
> Console.WriteLine(reader.ReadToEnd());
> myRes.Close();
>
> }
> finally { }
> }
> }
>
> ===== Test End ======
>
> Peter Magnusson
> mail:kmpm_se at msn.com
>
>
>
> _________________________________________________________________
> Skaffa fler messengerkontakter - Vinn 10.000 i resecheckar!
> http://messenger.msn.se/promo
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list