Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using System to write to a file

Status
Not open for further replies.

4getit

Programmer
Sep 15, 2006
8
US
I am writing a function for a Windows application that takes a few arguments. I then want to take the values of these arguments and write them to a file on the users machine using the System class to access the users datapath. I then want to read that file the next time the app is launched and pass the values in the file to a database server side and store the values. Does anyone know the correct syntax for accessing the users application datapath and the best way going about accomplishing this task?
 
Personally I would use the ConfigurationManager class to store the information in the App config file. What it sounds like you really want is application specific data persistence which is exactly what the App config file is for.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
FYI: Nearly all of the file I/O routines are in the System.IO namespace, not the System namespace.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top