Add a new line to a text File
-
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opslaan.Click FileOpen(1, "C:\Documents and Settings\Jurgen\Mijn documenten\Visual Studio Projects\Data test1\Data Testje 1\Log_uren_bijhouden.txt", OpenMode.Output) ' Open file for output. Print(1, TimeOfDay, Today) ' Print text to file. PrintLine(1) 'sluit 1ste regel af PrintLine(1) PrintLine(1, nummer.Text, naam.Text, achternaam.Text) PrintLine(1, "Begonnen om", TAB(1), beginuur.Text) ' Print in two print zones. PrintLine(1, "Beeindigd om", TAB(1), eindeuur.Text) ' Separate strings with space. PrintLine(1) PrintLine(1, TAB(10), "END", TAB(20), "END") ' Print word at column 10. PrintLine(1, "-------------------------------------------------------------------") FileClose(1) ' Close file. End Sub I want to add every time I klik a Button a new line with these text in the file. now when i try to do that he overwrites every time the existing Data. It has to somthing like a log file. I use Visual Basic.net, this because i can't work very wel with C++ Sombody a hint or a Solution, Thanks Jurgen De Bondt Thats ........ Me
-
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opslaan.Click FileOpen(1, "C:\Documents and Settings\Jurgen\Mijn documenten\Visual Studio Projects\Data test1\Data Testje 1\Log_uren_bijhouden.txt", OpenMode.Output) ' Open file for output. Print(1, TimeOfDay, Today) ' Print text to file. PrintLine(1) 'sluit 1ste regel af PrintLine(1) PrintLine(1, nummer.Text, naam.Text, achternaam.Text) PrintLine(1, "Begonnen om", TAB(1), beginuur.Text) ' Print in two print zones. PrintLine(1, "Beeindigd om", TAB(1), eindeuur.Text) ' Separate strings with space. PrintLine(1) PrintLine(1, TAB(10), "END", TAB(20), "END") ' Print word at column 10. PrintLine(1, "-------------------------------------------------------------------") FileClose(1) ' Close file. End Sub I want to add every time I klik a Button a new line with these text in the file. now when i try to do that he overwrites every time the existing Data. It has to somthing like a log file. I use Visual Basic.net, this because i can't work very wel with C++ Sombody a hint or a Solution, Thanks Jurgen De Bondt Thats ........ Me
Change the OpenMode.Output to OpenMode.Append. RageInTheMachine9532
-
Change the OpenMode.Output to OpenMode.Append. RageInTheMachine9532