aspose file tools*
The moose likes I/O and Streams and the fly likes Problem in saving File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Problem in saving File" Watch "Problem in saving File" New topic
Author

Problem in saving File

Ankur Pandya
Greenhorn

Joined: May 28, 2009
Posts: 3
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

Joined: Oct 27, 2005
Posts: 19760
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ankur Pandya
Greenhorn

Joined: May 28, 2009
Posts: 3
Thank you sir..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in saving File