【VB开源代码栏目提醒】:网学会员--在 VB开源代码编辑为广大网友搜集整理了:D重新登录.frm绩等信息,祝愿广大网友取得需要的信息,参考学习。
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmnewLog
Caption = "重新登录"
ClientHeight = 4395
ClientLeft = 60
ClientTop = 450
ClientWidth = 6255
LinkTopic = "Form1"
ScaleHeight = 4395
ScaleWidth = 6255
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
IMEMode = 3 'DISABLE
Left = 1620
MaxLength = 6
PasswordChar = "*"
TabIndex = 6
Top = 3120
Width = 2805
End
Begin VB.CommandButton CmdOk
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 1200
MaskColor = &H00FF8080&
Picture = "D重新登录.frx":0000
Style = 1 'Graphical
TabIndex = 4
Top = 3720
UseMaskColor = -1 'True
Width = 1095
End
Begin VB.CommandButton cmdCancel
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 3540
Picture = "D重新登录.frx":1943
Style = 1 'Graphical
TabIndex = 3
Top = 3720
Width = 1095
End
Begin VB.Frame Frame2
Height = 45
Left = 0
TabIndex = 1
Top = 600
Width = 6120
End
Begin MSComctlLib.ListView ListView1
Height = 2085
Left = 0
TabIndex = 2
Top = 720
Width = 6075
_ExtentX = 10716
_ExtentY = 3678
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
Icons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "D重新登录.frx":32FD
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "D重新登录.frx":3BD9
Key = ""
EndProperty
EndProperty
End
Begin
VB.Label Label3
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 885
TabIndex = 5
Top = 3240
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "企业通讯
管理系统"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 450
Left = 1440
TabIndex = 0
Top = 120
Width = 3195
End
End
Attribute VB_Name = "frmnewLog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim SQL As String
Dim msg As String
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Dim rst As ADODB.Recordset
Dim key As String '保存用户ID
Dim User_kind '保存用户类别
Dim list As ListItem
'添加用户
列表 SQL = " select * from 用户信息表 order by userID"
Set rst = SelectSQL(SQL, msg)
If rst.RecordCount = 0 Then
MsgBox ("请先创建用户信息!")
CmdOk.Enabled = False
Exit Sub
Else
'向ListView中添加数据
rst.MoveFirst
Do Until rst.EOF
key = rst.Fields("userID") & rst.Fields("userName")
User_kind = Trim(rst.Fields("userType"))
If User_kind = "管理人员" Then
'当时管理人员时,用图像2
Set list = ListView1.ListItems.Add(, , key, 2)
Else
Set list = ListView1.ListItems.Add(, , key, 1)
End If
rst.MoveNext
Loop
rst.Close
End If
End Sub
Private Sub ListView1_Click()
'取出当前用户ID操作
If ListView1.ListItems.Count > 0 Then
UserID = Left(Trim(ListView1.SelectedItem), 6) '取出当前用户ID
End If
End Sub
Private Sub CmdOK_Click()
'确定操作
Dim password As String
'判断用户是否存在
SQL = " select * from 用户信息表 where userID='" & UserID & "'"
Set rs = SelectSQL(SQL, msg)
If rs.RecordCount > 0 Then
password = Trim(rs.Fields("password")) '取出该用户的密码
Else
MsgBox ("数据库操作错误!")
Exit Sub
End If
'判断密码是否正确
If pass
word = Trim(txtPassword.Text) Then
LoginSucceeded = True
frmEDMS.Show
Unload Me
Else
MsgBox ("密码错误!")
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
LoginSucceeded = False
End If
End Sub
Private Sub cmdCancel_Click()
'退出操作
'设置全局变