What is the AppData folder?

  最近一直在纠结软件中用户配置信息以及数据库存放位置问题,winxp系统以前不存在UAC重定向问题,但是自从Win7系统以后就发现没有管理员权限时,安装在系统盘中的软件配置信息若需要读写操作时,系统会自动将这些配置文件和数据库重定向到当前用户的AppData\Local\VirtualStore目录中,虽然避免了系统报错问题,但是对于软件调试以及用户配置文件的修改造成了困扰。

  以下是微软官方给出的AppData的定义(虽然显示的为win8系统,但是个人认为对win7和win10都通用):

Applies to Windows 8.1, Windows RT 8.1

The AppData folder contains app settings, files, and data specific to the apps on your PC. The folder is hidden by default in File Explorer, and has three hidden sub-folders: Local, LocalLow, and Roaming.

  • Roaming. This folder (%appdata%) contains data that can move with your user profile from PC to PC—like when you’re on a domain—because this data has the ability to sync with a server. For example, if you sign in to a different PC on a domain, your web browser favorites or bookmarks will be available.
  • Local. This folder (%localappdata%) contains data that can't move with your user profile. This data is typically specific to a PC or too large to sync with a server. For example, web browsers usually store their temporary files here.
  • LocalLow. This folder (%appdata%/…/locallow) contains data that can't move, but also has a lower level of access. For example, if you're running a web browser in a protected or safe mode, the app will only be able access data from the LocalLow folder.

The apps themselves choose whether to save to the Local, LocalLow, or Roaming folders. Most desktop apps use the Roaming folder by default, while most Windows Store apps use the Local folder by default.

Warning

  • We don't recommend moving, deleting, or making any changes to files or folders in the AppData folder. Doing so could make your apps run poorly or stop working entirely.

  大部分桌面app程序都使用AppData\Roaming文件夹作为用户配置文件的存储位置,但是用户数据库若也存储在这个地方对于用户来说很不方便,文件夹为隐藏文件夹且不容易查找。我的解决方法是用户配置以及数据库文件默认路径为Romation文件夹,但是数据库文件夹路径是开放给用户的,用户可以自定义数据库存放位置,这样方便以后用户数据的备份以及恢复。

转载于:https://www.cnblogs.com/Joeyblog/p/4802729.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值