开发者

Access to the Environment.SpecialFolder

开发者 https://www.devze.com 2023-03-30 18:45 出处:网络
My Desktop Application needs to store and retrieve data from files stored in ProgramData folder (in Win 7). How can I get access to the Environment.SpecialFolder regardless o开发者_运维百科f the Opera

My Desktop Application needs to store and retrieve data from files stored in ProgramData folder (in Win 7). How can I get access to the Environment.SpecialFolder regardless o开发者_运维百科f the Operating System whether it is Win 7 or Win XP? Thanks.


I am not sure Java provides this. You can access it, on Windows 7 through the environment variable CSIDL_COMMON_APPDATA or ProgramData:

File appData = new File(System.getenv("CSIDL_COMMON_APPDATA"));
0

精彩评论

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