-
October 18th, 2010, 02:29 AM
#1
Saving input information to a .txt file
I`m having trouble saving input info to a file.
So, i`m using 2 commands.
1) System.IO.File.ReadAllLines()
2) System.IO.File.WriteAllLines()
So, what are the arguments of these commands? Okay, i know what they are - string path, string[] contents, Encoding etc, but i dont actually know what they mean, could anyone explain me, with examples? And will theese commands save all inputted info to the file(the program is a cikle which asks to input ex. The last name, occupation, incomes etc of countless people and i want all the information to be saved into a .txt file, line by line )
P.S i`m using NET3.5 / VS 2008
Last edited by solovirs; October 18th, 2010 at 02:39 AM.
-
October 18th, 2010, 03:00 AM
#2
Re: Saving input information to a .txt file
string path - Is the path where is file getting stored/saved in the hard disk/memory.
eg; C:/Data/Values
string[] contents --> Is the array of contents which are written to the file.
Encoding --> Is the format in which the data is written.. Is it binary, ascii, etc...
study in MSDN more about these functions...
-
October 18th, 2010, 03:53 AM
#3
Re: Saving input information to a .txt file
could you explaim me a little of "string[] contents --> Is the array of contents which are written to the file."?
used StreamWriter, got it, but thanks anyway
P.S
How can i make a program to show tommorov`s or next week`s date?
Last edited by solovirs; October 18th, 2010 at 05:23 AM.
-
October 18th, 2010, 07:41 AM
#4
Re: Saving input information to a .txt file
How can i make a program to show tommorov`s or next week`s date?
and where can i get all info obout formating date and time?
-
October 18th, 2010, 12:14 PM
#5
Re: Saving input information to a .txt file
You know, the language and standard API is documented:
http://msdn.microsoft.com/en-us/libr...ealllines.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|