dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Saving input information to a .txt file

  1. #1
    Join Date
    Oct 2010
    Posts
    7

    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.

  2. #2
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    435

    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...

  3. #3
    Join Date
    Oct 2010
    Posts
    7

    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.

  4. #4
    Join Date
    Oct 2010
    Posts
    7

    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?

  5. #5
    Join Date
    Jun 2008
    Posts
    2,477

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)