开发者

Allowing WPF application to write to an XML file

开发者 https://www.devze.com 2023-02-20 01:10 出处:网络
I have developed a WPF application and set up a deployment project. The installer works perfectly and so does the application, until it tries to do a entry in an XML开发者_开发问答 file. These file ac

I have developed a WPF application and set up a deployment project. The installer works perfectly and so does the application, until it tries to do a entry in an XML开发者_开发问答 file. These file act as an XML database for the application and are included in Application folders. Where am i going wrong. Do i need to assign some kind of privileges


No, noting is wrong with the app.

You have to read documentation. You are NOT SUPPOSED TO WRITE INTO THE APPLICATION FOLDER since Windows NT4 or something. There are special folders to write into, and a method to get them. On normal modern windows the app folder is write protected for normal users, as it should be. It is the program folder.

Move your data over to the APPDATA folder, into a subfolder for your database.

Start at http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx for documentation.

Read the Windows guideleines for programming for the windows platform. There are a number of "do" and "do not do" there. Writing into the applications folder is one of the first "do not do".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号