wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Problem in saving File" Watch "Problem in saving File" New topic

Problem in saving File

Ankur Pandya

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

Joined: Oct 27, 2005
Posts: 19649

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.

How To Ask Questions How To Answer Questions
Ankur Pandya

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
Similar Threads
Error in starting Jboss through Command Prompt
Configuring a SQL datasource
Setting Java Classpath in Microsoft XP OS
can't get Java to run
JVM crash due to perm gen space 99% in use