Private Sub Btn_Aceptar_Click ( ByVal sender As System.Object, ByVal e As System.EventArgs ) Handles Btn_Aceptar.Click
Const RutaCockie As String = "C: \\ cockie.txt"
If ChkRecordar.Checked = True Then 'activate the check if we save the data file texo
Dim sw As New System.IO.StreamWriter (RutaCockie)
sw.WriteLine (Txt_NomUsu.Text)
sw.WriteLine (Txt_ClaUsu.Text) 'well you have no doubt the key coded or otherwise any cat could investigate the Cockies curious and watch the absurdity of your password: porsiempretuyo123
sw.Close ()
Else
If IO.File.Exists (RutaCockie) Then
My . Computer.FileSystem.DeleteFile (RutaCockie) 'I recommend you delete the file if you have saved before and now regret oz to it first if the file comprobareis existeis
End If
End If
End Sub
Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load
Const RutaCockie As String = "C: \\ cockie.txt" 'may be another route, curse you desire, all the rights of free expression will take shelter
If IO.File.Exists (RutaCockie) Then 'if file exists, it means that guardastes coockie data in each line and read the text data
ChkRecordar.Checked = True
Dim sr As New System.IO.StreamReader (RutaCockie, True )
sr.ReadLine Txt_NomUsu.Text = 'read the first line where I would be the name user in that order because it should've saved
Txt_ClaUsu.Text = sr.ReadLine 'Leea the second line
sr.Close ()
End If
End Sub
0 comments:
Post a Comment