basically the topic says it all.
i have an app that when the user clicks print it makes a txt file and executes it with notepad so they can adjust font or size and print from there,(i dont work with printing yet) everything works fine except one problem.
i save the txt document using
CODE
System.IO.StreamWriter tw = new System.IO.StreamWriter("C:\\tempprint.txt");
tw.WriteLine(listViewContent.ToString());
tw.Close();
this works perfect on my computer, but i've tested it on other computers and some of them tell me that access is denied (cause it wont let you write directly to the c drive) and the program crashes. i put a try catch around it to explain to the user what the problem is instead of crashing but what id like to be able to do is get a string variable for the directory my exe is stored in and use that instead of ("C:\\tempprint.txt");
not to mention some crazy ass may not have a "C" drive.
thanks in advance for any help.
This post has been edited by Extas: 18 Apr, 2008 - 06:29 AM