mmm vale.... s00rk
lo he intentado pero me he dado cuenta que se menos de esto de lo que imaginaba jejejeje
veras el problema ahora me reside en el punto de escribir el codigo para que al hacer click en el boton haga el procedimiento que me dices....y es que no tengo ni idea de cual es el codigo
habia intentado algo asi como: If UsuarioTextBox1(nombre del textbox) = Database1DataSet1.Usuarios_Form(nombre de la tabla) Then.... pero hay me kedo ya que el programa no me reconoce el "="....
me dice: Operator '=' in not defined for types 'system.windows.forms.textbox' and 'sqldatabase.database1dataset1.usuarios_formdatatable'.
Este es el codigo que use para guardar un solo usuario y una contraseña:
quise guiarme pero nada.
Public Class LoginForm1
' TODO: Insert code to perform custom authentication using the provided username and password
' (See
http://go.microsoft.com/fwlink/?LinkId=35339). ' The custom principal can then be attached to the current thread's principal as follows:
' My.User.CurrentPrincipal = CustomPrincipal
' where CustomPrincipal is the IPrincipal implementation used to perform authentication.
' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
' such as the username, display name, etc.
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Aceptar.Click
If TextBox1.Text = "xxxxxx" And TextBox2.Text = "xxxxxx" Then
If CheckBox1.Checked = True Then
My.Settings.xxxxxx= TextBox1.Text
My.Settings.Save()
My.Settings.Reload()
Else
My.Settings.xxxxxx = ""
My.Settings.Save()
My.Settings.Reload()
End If
If CheckBox2.Checked = True Then
My.Settings.xxxxxxx = TextBox2.Text
My.Settings.Save()
My.Settings.Reload()
Else
My.Settings.xxxxxx = ""
My.Settings.Save()
My.Settings.Reload()
End If
If CheckBox1.Checked = True And CheckBox2.Checked = True Then
My.Settings.xxxxxxx= TextBox1.Text
My.Settings.xxxxxxx = TextBox2.Text
My.Settings.Save()
My.Settings.Reload()
Else
My.Settings.xxxxxx= ""
My.Settings.xxxxxx = ""
My.Settings.Save()
My.Settings.Reload()
End If
MsgBox("Bienvenido" & TextBox1.Text & ".")
MDIParent1.Show()
Me.Hide()
Else
MsgBox("Usuario o contraseña Incorrectos.", MsgBoxStyle.Critical)
End If
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancelar.Click
Me.Close()
SplashScreen1.Close()
End Sub
Private Sub LoginForm1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If CheckBox1.Checked = False Then
My.Settings.xxxxxxxx = ""
End If
If CheckBox2.Checked = False Then
My.Settings.xxxxxxx = ""
End If
If CheckBox1.Checked = False And CheckBox2.Checked = False Then
My.Settings.xxxxxxx= ""
My.Settings.xxxxxx = ""
End If
End Sub
Private Sub LoginForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Text = My.Settings.xxxxxxxx
TextBox2.Text = My.Settings.xxxxxxx
If TextBox1.Text = "xxxxxx" Then
CheckBox1.Checked = True
End If
If TextBox2.Text = "xxxxxxxx" Then
CheckBox2.Checked = True
End If
If TextBox1.Text = "xxxxx" And TextBox2.Text = "xxxxxx" Then
CheckBox1.Checked = True
CheckBox2.Checked = True
End If
End Sub
Private Sub Limpiar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Limpiar.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class