0

Hey ,
i am trying to make an encryption program . With any codes i've found until now i didn't manage to solve my problem . my problem is about saving my data from a multiline text box to a text file . Basically i want , by clicking on a command button , a txt file to be created and anything i have in my text box to be save on that text file .

ilias_de

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by vadiraj
0

Hey ,
i am trying to make an encryption program . With any codes i've found until now i didn't manage to solve my problem . my problem is about saving my data from a multiline text box to a text file . Basically i want , by clicking on a command button , a txt file to be created and anything i have in my text box to be save on that text file .

ilias_de

This code may help you. it creates one word file if it is not exist and then assigns ur textbox value to that file. ITdoes not overwrite the file . If you want to overwrite you have to change the code...
im using rich textbox and creating document called mydoc7.doc in local system and saving richtextbox value in mydoc7.doc.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim arr As String = RichTextBox1.Text
System.IO.File.AppendAllText("c:\mydoc7.doc", arr)


End Sub

0

This code may help you. it creates one word file if it is not exist and then assigns ur textbox value to that file. ITdoes not overwrite the file . If you want to overwrite you have to change the code...
im using rich textbox and creating document called mydoc7.doc in local system and saving richtextbox value in mydoc7.doc.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim arr As String = RichTextBox1.Text
System.IO.File.AppendAllText("c:\mydoc7.doc", arr)


End Sub

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.