Skip to content

Commit

Permalink
访客模式
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Jun 13, 2016
1 parent 395827e commit 443e445
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Chemistry.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Description="Chemical Tools"
CompatibleMode="0"
MajorVer=2
MinorVer=0
RevisionVer=14
RevisionVer=15
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="����ʦ����ѧ�Ŷ�һ��"
Expand Down
10 changes: 5 additions & 5 deletions Chemistry.vbw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
frmMain = 388, 158, 916, 594, , 292, 28, 885, 466, C
frmMain = 393, 155, 921, 591, , 292, 28, 885, 466, C
modCalculate = 335, 73, 1359, 497,
modData = 207, 26, 1070, 570, C
modData = 251, -4, 1114, 542,
frmElement = 34, 92, 920, 532, C, 104, 104, 990, 544, C
frmMass = 163, 208, 1053, 650, C, 43, 123, 929, 617, C
modUI = 157, 25, 1043, 461, C
Expand All @@ -9,9 +9,9 @@ modExam = 40, 26, 926, 466, C
frmExam = 162, 158, 1093, 598, C, 133, 77, 1019, 548, C
frmAbout = 104, 104, 989, 544, C, 156, 142, 1042, 596, C
frmOptions = 186, 137, 1072, 577, C, 108, 6, 994, 564, C
frmLogin = 445, 53, 1001, 477, C, 74, 117, 600, 541, C
frmSignUp = 0, 0, 527, 424, C, 499, 63, 1026, 487, C
frmLogin = 187, 212, 1008, 636, , 74, 117, 600, 541, C
frmSignUp = 466, 23, 993, 447, , 499, 63, 1026, 487, C
FrmChangePassword = 167, 159, 1051, 599, C, 156, 156, 1041, 596, C
frmpH = 87, 66, 971, 506, C, 394, 81, 1278, 540, C
frmThermodynamics = 232, 20, 1117, 460, , 191, 102, 1075, 612, C
frmThermodynamics = 232, 20, 1117, 460, C, 191, 102, 1075, 612, C
frmGas = 401, 139, 1285, 578, , 134, 16, 1018, 596, C
21 changes: 19 additions & 2 deletions frmLogin.frm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Begin VB.Form frmLogin
ScaleHeight = 4995
ScaleWidth = 7335
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "访客模式"
Height = 615
Left = 4800
TabIndex = 8
Top = 4320
Width = 1215
End
Begin VB.CheckBox chkAutoLogin
BackColor = &H00C0FFFF&
Caption = "自动登陆"
Expand All @@ -35,7 +43,7 @@ Begin VB.Form frmLogin
Begin VB.CommandButton cmdSignUp
Caption = "注册"
Height = 615
Left = 4080
Left = 3120
TabIndex = 5
Top = 4320
Width = 1215
Expand Down Expand Up @@ -144,8 +152,17 @@ Private Sub cmdSignUp_Click()
frmSignUp.Show 1
End Sub

Private Sub Command1_Click()
If Not dataSignUp("访客", "user") Then dataRenew
texUsername = "访客"
texPassword = "user"
chkPassword.value = False
chkAutoLogin.value = False
Call cmdLogin_Click
End Sub

Private Sub Form_Load()
If HisUsername <> "" Then
If HisUsername <> "" And HisUsername <> "访客" Then
texUsername = HisUsername
If HisPassword <> "" Then
texPassword = HisPassword
Expand Down
2 changes: 2 additions & 0 deletions frmSignUp.frm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ End Sub
Private Sub cmdSignUp_Click()
If texUsername = "" Then
MsgBox "请输入用户名!", vbOKOnly, "错误"
ElseIf texusename = "访客" Then
MsgBox "禁止使用该用户名!", vbOKOnly, "错误"
ElseIf texPassword = "" Then
MsgBox "请输入密码!", vbOKOnly, "错误"
ElseIf texPassword <> texAgain Then
Expand Down
6 changes: 5 additions & 1 deletion main.frm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ Private Sub cmdGas_Click()
End Sub

Private Sub cmdNewPassword_Click()
FrmChangePassword.Show 1
If DataUsername = "访客" Then
MsgBox "访客禁止修改密码!", vbOKOnly, "错误"
Else
FrmChangePassword.Show 1
End If
End Sub

Private Sub cmdpH_Click()
Expand Down
Binary file modified mdb/User.mdb
Binary file not shown.
30 changes: 30 additions & 0 deletions modData.bas
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,33 @@ Public Function dataChangePassword(Username As String, Password As String, NewPa
Call dataClose
End Function

Public Function dataRenew() As Boolean
dataRenew = True
Call dataOpen(2)
DataAdodbRs.Open "select * from [User]"
While Not DataAdodbRs.EOF And dataRenew = True
If Not IsNull(DataAdodbRs!Username) Then
If CStr(DataAdodbRs!Username) = "访客" Then
dataRenew = False
Else
DataAdodbRs.MoveNext
End If
End If
Wend
DataAdodbRs("Password") = dataPasswordLock("user")
DataAdodbRs("UseNumber") = 0
DataAdodbRs("TimeMax") = 60
DataAdodbRs("NumberMax") = 100
DataAdodbRs("NoMax") = 20
DataAdodbRs("ScoreMax") = 0
DataAdodbRs("ScoreTime") = "N/A"
DataAdodbRs("TimeIf") = "True"
DataAdodbRs("Element") = ""
DataAdodbRs("Mass") = ""
DataAdodbRs("c") = ""
DataAdodbRs("pKw") = "14"
DataAdodbRs("pKa") = ""
DataAdodbRs("AB") = "A"
DataAdodbRs.Update
Call dataClose
End Function

0 comments on commit 443e445

Please sign in to comment.