简体   繁体   中英

How to save textbox text to notepad and save again a textbox text to add it into the same note pad?

I want to save my textbox1.text in a notepad of my computer. And after saving that, I will save the next textbox1.text again. But I want it to be added to the same notepad. Anyone can help me on the code? Using VB net.

I have a one form with controls and all entries will be displayed on one textbox. I want to save that textbox but I don't know how.

You could use the File.AppendAllText method to save the text to a file:

Public Sub SaveTextToFile(FilePath As String, Text As String)
    System.IO.File.AppendAllText(FilePath, Text)
End Sub

Here is an example of using the method:

SaveTextToFile("C:\New.txt", textBox1.Text)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM