<b>Error 1 System.IO.StreamReader' does not contain a definition for 'close' </b> ...is that so . update this with the correct code.. // if(!Page.IsPostBack) { StreamReader strmEditFile; try{ //Open the file strmEditFile = File.OpenText(strPath + "\\" + strFile); //Read its text txtEditFile.Text = strmEditFile.ReadToEnd().ToString(); //Close the file. strmEditFile.close(); } catch(FileNotFoundException ex) { // If it does not exists . create it. File.CreateText(strPath + "\\" + strFile).Close(); //Clear the text Box txtEditFile.Text = ""; } catch(System.UnauthorizedAccessException ex) { Server.Transfer("NotAuthorized.aspx"); } <b><u> and u 9 what catch block is also showing error that ex(object) is declared but not used here ,,,, Please guide as earliest as possible</u></b> --
strmEditFile.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)