Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got this
error:

---------------
Unhandled Exception: System.Net.WebException: The underlying connection was
closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ReadXMLfromURL.Class1.CaptureInfo(Object state) in c:\Documents and
Settings\Binh.EEE\Local

settings\Temp\SnippetCompilerTemp\c60a33a1-29ba-4601-9d92-3bae54b7720f\0:line
32
--------------



This is the code
--------------------

using System;

using System.Xml;

using System.IO;



namespace ReadXMLfromURL

{

class Class1

{

static void Main(string[] args)

{

String URLString =
"http://www.worldpress.org/feeds/wprw.xml";

String[] Str = new String[3];

int count = 0;



XmlTextReader reader = new XmlTextReader
(URLString);



while (reader.Read() & (count<3))

{

switch (reader.NodeType)

{

case
XmlNodeType.Element: // The node is an element.

if
(reader.Name == "title")

{


reader.Read();


Str[count] = reader.Value;


count++;

}

Console.WriteLine("<"
+ reader.Name);

break;

}



}

for (count=0;count<3;count++)

Console.WriteLine(Str[count]);

}



}



}

-------------------------------



Appreciate if you can help.

Thanks.

Re: Need help for dotNet by Richard

Richard
Mon Oct 18 02:08:27 CDT 2004

Can you connect to the resource from a browser in the office?

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog


Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got this
error:
<snip>



Re: Need help for dotNet by Binh

Binh
Mon Oct 18 20:07:11 CDT 2004

Yes, of course, I can connect the resource from a browser.


"Richard Blewett [DevelopMentor]" <richardb@develop.com> wrote in message
news:OXt%23EFOtEHA.3412@TK2MSFTNGP14.phx.gbl...
> Can you connect to the resource from a browser in the office?
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://staff.develop.com/richardb/weblog
>
>
> Hi,
> I write a C# to get information from a XML site, when I run my program at
> home, there's no problem.
> But when in office (no proxy, no firewall, port 80 is open), I've got this
> error:
> <snip>
>
>