1
Reply

Event Handling

Tom

Tom

Sep 19 2008 5:33 AM
2.1k
Hi there, i am trying to use Error Handling to wait for a File Not Found error

               try
                {
                TextReader tr = new StreamReader(Path);
                }

                catch(FileNotFoundException fnf)
                {
                  StatusLabel.Text = "File Not Found !"; 
                }

If i do this and try and run the program, it can not see the TextReader tr instance further down in my code... Any ideas ?
Thanks in advance

Answers (1)