Friday, July 2, 2010

How To Lay A Floor In A Boat

Remember username and password login in a practical way


infatuated
Sometimes we are looking for an effective and reliable solution to our application to establish functional attributes that we miss the idea of \u200b\u200ba practical solution rather simple. For example one of these would be the attempt to attribute to our form login remember our ownership of data if they wish.

had investigated several articles in which by the grace of St. google I ran into types and delivering asking you to work with coockie, yes, that archivito in text format that is indispensable for those who have not the slightest time to re-enter your user details to access your favorite site. However, if such insurance will not vb.Ne code that you permitais estois t attributes, but it's too tedious to be referencing libraries and writing code that may never will understand, so I oz say do not complicate life and develop your own coockie with the following example in vb.Net :

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