File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Spring in Action this week in the Spring forum!
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: 19719
    
  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..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in saving File