Problems with HttpWebResponse

K

kardath

Hi,

I have some problem with the following code :

HttpWebResponse result =
(HttpWebResponse)req.GetResponse();

//result.ContentLength -> 159

Stream ReceiveStream = result.GetResponseStream();

//result.CharacterSet -> ""
//result.ContentType -> text/html; charset=utf-8
//result.ContentEncoding -> ""
//result.Headers -> Date: Tue, 25 Jul 2006 10:58:47 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Set-Cookie:
ASP.NET_SessionId=zmksm055kvyigzmlvxgohqe2; path=/
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 159


StreamReader XMLRead = new StreamReader(ReceiveStream,
System.Text.Encoding.UTF8);
String read = XMLRead.ReadLine();

//read is empty!!!

My problems is that the string read is empty....

Have you an idea?

Thanks
 
P

pwraustin

Hi kardath. Do you want to read all the html content or just one line?.
Try with the ReadToEnd() message in your XMLRead object.

Austin

kardath escribió:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top