I managed to figure out how to read data in from a text file in my program directory. How can I access a text file that is online?
When I run the program, there I get the argument exception error.
What did I do wrong?
You also might (or might not) want to know that I'm using Visual C++ 2005 Express Edition on XP.
Code:
try{
StreamReader^theReader = gcnew StreamReader("[URL unfurl="true"]http://www.whatever.com/file.txt");[/URL] //not the actual address, of course
}
catch(FileNotFoundException^g){
MessageBox::Show("File Not Found Exception:\r\n\r\n" + g, "alert", MessageBoxButtons::OK);
}
catch(ArgumentException^f){
MessageBox::Show("Argument Exception:\r\n\r\n" + f, "alert", MessageBoxButtons::OK);
}
When I run the program, there I get the argument exception error.
What did I do wrong?
You also might (or might not) want to know that I'm using Visual C++ 2005 Express Edition on XP.