How to create an .INI file to store some settings in Java?

后端 未结 6 1239
悲&欢浪女
悲&欢浪女 2020-12-08 01:09

I want to create an ini file to store some settings for my application. Is it a good idea to find where the jar file is located and create an ini file there? If yes, then ho

6条回答
  •  悲哀的现实
    2020-12-08 01:56

    You should not be storing temp files in the install directory of an application. Remember, the user running the application may not have write access to that directory. The safest place to put stuff like that is in C:\Documents and Settings\username\Application Data\ApplicationName folder (adjusting the name as necessary).

    That said, however, I would probably store that type of stuff in the registry instead of a file on their computer. (But, that's just me.)

提交回复
热议问题