Dillon Goeda

Dillon Goeda

  • NA
  • 22
  • 11k

path for files to write to after installation

Apr 6 2013 5:50 AM
Hey Guys,

I developed a C# windows application that deals with customs and orders, I used text files to store the customer details and the order details. The problem is when I install my app on other computers, it installs in the Program files directory and I'm not allowed to write to the text files (add new customer or new order). I get an access denied error message

Where can I save my text files?? what should make the 'path' of my StreamWriter? how do create that path or folders when I install the app?

My current code is something like:

String path = "customer.txt";

....

StreamWriter customerWriter = new StreamWriter(path,true);