How is .txt file different from a .dat file in C?

How can i save text box information into .txt file in vb programming language?

  • Hi!friends...i am making a vb program in which i have to save information in the text box written by the user into .txt file.I know how to save it in .txt file.But problem occurs when i run the program again and again,and when i save it by clicking command button.Because it erases all the information which was previously saved into .txt file and saves all new information typed in text boxes. In short i can say that if i want create a program which saves all the information of all the employee then what should i do? =>I can explain my problem with following example: We know that at one time only one person will enter his/her information.And he/she saves that data by clicking save command button. Then another person will enter his/her information in text boxes and saves it by clicking save command button. My problem is that if 1st person enters his/her data in text boxes and saves it then if 2nd person enters his/her data and saves it.Then only 2nd person's data is available in .txt file. Actually problem is with the path c:\outut.txt given in command button by me.But i don't how program can automatically save new employee information or data with new .txt file name. If it is possible then what step should be taken by me to solve this problem. REPLY ME AS SOON AS POSSIBLE .YOUR ANSWER IS PRECIOUS TO ME.DON'T FORGET TO GIVE YOUR NAME.I WILL WAIT.....BYE

  • Answer:

    I'm not sure which method your using to write to file, but all of them that I know of have an option to append, rather than overwrite. open c:\outut.txt for append as #1 'the last param is a boolean for append mode My.Computer.FileSystem.WriteAllText("C… "Text", True) for stringwriter, streamwriter or other classes that inherit textwriter Dim sw As System.IO.StreamWriter sw = System.IO.File.AppendText(path) sw.Write(Text)

divyesh r at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.