Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in saving File

 
Ankur Pandya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir,
I am developing a desktop application in JAVA - Swing.
For this app I have to store username and password in a textfile in order to login automaticaly at next start.
Now, I want to save this file in System32 folder in Windows, than which path should I write..??
Right now I m using C://windows//system32 path, but it is static and creates problem when windows is installed in d: or anywhere else..
so, which path should I use..??
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use a sub path of System.getProperty("user.home"). For me that call returns "C:\Documents and Settings\MyUserAccount", on a Linux machine it would return "/home/myuseraccount", etc.
 
Ankur Pandya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic