Correct way to design around Windows UAC limitations?

后端 未结 2 1187
北恋
北恋 2020-12-31 21:38

I found out an application I wrote does not work properly under Windows Vista/7 if UAC is enabled at any level, because it writes files to the install directory of the progr

2条回答
  •  时光说笑
    2020-12-31 22:00

    Per-user application specific data should be written in the AppData folder.

    You should use SHGetKnownFolderPath with FOLDERID_LocalAppData.

    In managed code, you should use System.Environment.GetFolderPath with System.Environment.SpecialFolder.LocalApplicationData.

提交回复
热议问题