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"));
精彩评论