In my book that i got with vb.net there was this little code on encrypting text and saving it, when i moved it over to my code and program it didnt save the text. It loads it up but there is no text in the textbox. Why doesnt it save the actual text? ill post a code here in a sec.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = UserName txtnote.Text = password UserName = TextBox1.Text password = txtnote.Text Dim Encrypt As String = "" Dim letter As Char Dim i, charsInFile As Short Dim form1 As Form1 SaveFileDialog1.Filter = "Text files (*.txt)|*.txt" SaveFileDialog1.ShowDialog() If SaveFileDialog1.FileName <> "" Then charsInFile = txtNote.Text.Length For i = 0 To charsInFile - 1 letter = txtNote.Text.Substring(i, 1) Encrypt = Encrypt & Chr(Asc(letter) + 1) Next FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output) PrintLine(1, Encrypt) 'copy text to disk FileClose(1) txtNote.Text = Encrypt txtNote.Select(1, 0) 'remove text selection TextBox1.Text = Encrypt TextBox1.Select(1, 0) End If End Sub




Reply With Quote