title: C# An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
body: <p>Good morning everyone,</p>
  
  <p>I have created setup wizard for application, when I'm running application I can see data from txt files which are inside instaled folder, but when I'm trying edit data inside txt file I have got an error </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
    Additional information: Access to the path 'C:\Program Files (x86)\Jean-Paul Sartre Variety Theatre\CustomerStorage.txt' is denied.</p>
  </blockquote>
  
  <pre><code>string text = "";
  StreamWriter sw = new StreamWriter("CustomerStorage.txt");  //THAT LINE GENERATE ERROR  
  
  foreach (var item in Customers)
  {
      text = item.Value.CustomerName + "*" + item.Value.CustomerEmail + "*" + (int)item.Value.Customertype + "*" + item.Value.BookDate + "*" + item.Value.CustomerNo + "*" + item.Value.BookedPlayName + "*" + item.Value.PaymentStatus + "*" + item.Value.SeatNoOne + "*" + item.Value.SeatNoTwo + "*" + item.Value.SeatNoThree + "*" + item.Value.SeatNoFour + "*" + item.Value.SeatNoFive + "*" + item.Value.SeatNoSix + "*" + item.Value.PriceToPay + "*" + item.Value.GetPlayNo + "*" + item.Value.TotalNumberOfSeatsCustomer + "*";
      if (item.Value.Customertype == CustomerType.GoldMember)
      {
          GoldMember gm = (GoldMember)item.Value;
          //saving gold member with new created date
          gm.CreatedDate = gm.CreatedDate;
          text += gm.CreatedDate + "*";
      }
      sw.WriteLine(text);
  }
  sw.Close();
  </code></pre>
  
  <p>I don't know if I made any mistake during creating setup wizard and I should make someting like permission during adding txt file into file system folder. </p>