Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading data from online text file...

Status
Not open for further replies.

Cobra220

Programmer
Dec 17, 2006
8
US
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?

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top