viktor80 viktor80 - 2 months ago 13
C# Question

Correct way to locate text document for windows form application executable

what is a correct way to save text document for windows form application executable file for other user. Now I got it in D:\Pro\bin\Debug folder usually

"doc.txt";


maybe better go this way:

@"c:\temp\doc.txt";


or this:

"C:\ProgramData\doc\doc.text";


or maybe better some other way?

Answer

Saving the file to the exeutable path folder works, since another user will need to have acces to that path to be able to execute the program in the first place.

Alternatives would be:

C:\Users\Public\AppData\Roaming\AppFolder or %ProgramData%.

Comments