?? login.vb
字號:
Public Class Login
Inherits System.Windows.Forms.Form
#Region " Windows 窗體設計器生成的代碼 "
Public Sub New()
MyBase.New()
'該調用是 Windows 窗體設計器所必需的。
InitializeComponent()
'在 InitializeComponent() 調用之后添加任何初始化
End Sub
'窗體重寫 dispose 以清理組件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗體設計器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下過程是 Windows 窗體設計器所必需的
'可以使用 Windows 窗體設計器修改此過程。
'不要使用代碼編輯器修改它。
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Login))
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(72, 192)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(112, 21)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(240, 192)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBox2.Size = New System.Drawing.Size(120, 21)
Me.TextBox2.TabIndex = 3
Me.TextBox2.Text = ""
'
'Button1
'
Me.Button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
Me.Button1.Location = New System.Drawing.Point(408, 189)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 7
Me.Button1.Text = "登陸"
'
'Button2
'
Me.Button2.BackColor = System.Drawing.SystemColors.ActiveCaptionText
Me.Button2.Location = New System.Drawing.Point(488, 188)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 8
Me.Button2.Text = "注冊"
'
'Login
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
Me.ClientSize = New System.Drawing.Size(600, 253)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MaximumSize = New System.Drawing.Size(608, 280)
Me.MinimumSize = New System.Drawing.Size(608, 280)
Me.Name = "Login"
Me.Text = "用戶登陸"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
search.init()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As DataSet
ds = search.query("select * from T_User where C_UserId = '" & TextBox1.Text & "' ")
If ds.Tables(0).Rows.Count = 0 Then
MsgBox("沒有該用戶", vbOKOnly + vbExclamation, "警告")
TextBox1.Text = ""
TextBox2.Text = ""
Else
ds.Clear()
ds = search.query("select * from T_User where C_UserId = '" & TextBox1.Text & "' and C_Password= '" & TextBox2.Text & "' ")
If ds.Tables(0).Rows.Count = 0 Then
MsgBox(" 密碼錯誤-_-!!! " & (Chr(13)) & " 請確認后再輸入!")
TextBox2.Text = ""
Else : Dim Man As New Manager
UserInfo.UserName = TextBox1.Text
UserInfo.UserStyle = ds.Tables(0).Rows(0).Item(2)
UserInfo.Log = Me
TextBox1.Text = ""
TextBox2.Text = ""
Me.Hide()
Man.Show()
End If
End If
End Sub
Private Sub Login_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If MsgBox("您真的不登錄GoodEdu學生信息管理管理系統嗎?", _
MsgBoxStyle.YesNo + MsgBoxStyle.Question, "退出登錄系統") _
= MsgBoxResult.Yes Then
e.Cancel = False
Else
e.Cancel = True
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Reg As New Register
Reg.Show()
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -