I am creating a text document which will be used to transmit medical claims. The location of the claims file is in the:
C:\Program Files (x86)\KIP\ECS_Folder\ directory.
On my computer, everything works great, but the end user is getting an IO Error and the application crashes.
I am sure this is a permissions error.
Where would be the best place to create this text document - with the least chance of errors and so the end user can easily navigate to it to send it to the clearinghouse?
Would the Desktop or the Documents directory be more appropriate?
If it is a document that you want the user to be able to access later on, put it in Documents. Otherwise, create a folder for your app in ApplicationData and put it there.
Any Program Files in Vista or later balks at writing anything without elevated permissions. The purpose of this restriction is to stop you from writing anything there (the exception is when you install the program).
To expand on Tim’s comment, a Document is typically a file that the user of your program opens or creates. If it’s something that is more internal to your program, use ApplicationData. There’s overlap in concepts here, but generally that’s the distinctions.
I assume this same concept applies to the Mac as well.