|
-
Aug 31st, 2011, 01:52 AM
#8
Thread Starter
Frenzied Member
Re: how come it's not writing the the executable's directory?
 Originally Posted by Evil_Giraffe
If you mean without changing these lines to include a full path:
csharp Code:
StreamWriter sw = new StreamWriter("a.txt");
That will always write to the current working directory. I cannot stress enough that to change the working directory to the application's folder is not the behaviour expected of a Windows program. It is possible to do, but for the above mentioned reasons I am not going to signpost the way for you.
So the proper programming "etiquette" is to NOT put any output files (created by the program) in the executable's folder/subfolder? (Assuming the user is not given any choice to which path to save it to)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|