Hello!

I'm playing around trying to read XML-files from the Internet to parse, but I can't get it to work at all. Some code:

try {
HttpWebRequest^ req = dynamic_cast<HttpWebRequest^> (WebRequest::Create( "http://www.xmlfiles.com/examples/note.xml" ));
HttpWebResponse^ res = dynamic_cast<HttpWebResponse^> (req->GetResponse());


Stream^ stm = res->GetResponseStream();
XmlTextReader^ reader;
try {reader = dynamic_cast<XmlTextReader^>(XmlTextReader::Create(stm)); }
catch (...){Console::WriteLine("b");}

while (reader->Read()){
switch (reader->NodeType){
default:
Console::WriteLine("a");
// Console::WriteLine(String::Concat( reader->NodeType.ToString(), ": ","<", reader->Name, ">",reader->Value));
break;
}
}
}
catch (Exception^ e){
Console::WriteLine(e->StackTrace);
Console::WriteLine(e->Message);
}

All I get is an error: "Object reference not set to an instance of an object. The stacktrace points at the Read()-operation.

Anyone know about how to solve this?