?? frmlogin.frm
字號:
VERSION 5.00
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash9c.ocx"
Begin VB.Form frmLogin
Caption = "歡歡圖書銷售系統"
ClientHeight = 3930
ClientLeft = 60
ClientTop = 450
ClientWidth = 4980
Icon = "frmlogin.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3930
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdok
Caption = "登 錄"
Default = -1 'True
Height = 495
Left = 840
TabIndex = 6
Top = 3240
Width = 1215
End
Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1
Height = 1935
Left = 0
TabIndex = 5
Top = 0
Width = 4935
_cx = 8705
_cy = 3413
FlashVars = ""
Movie = "D:\VB登陸界面.swf"
Src = "D:\VB登陸界面.swf"
WMode = "Window"
Play = -1 'True
Loop = -1 'True
Quality = "High"
SAlign = ""
Menu = -1 'True
Base = ""
AllowScriptAccess= ""
Scale = "ShowAll"
DeviceFont = 0 'False
EmbedMovie = 0 'False
BGColor = ""
SWRemote = ""
MovieData = ""
SeamlessTabbing = -1 'True
Profile = 0 'False
ProfileAddress = ""
ProfilePort = 0
AllowNetworking = "all"
AllowFullScreen = "false"
End
Begin VB.CommandButton cmdcancel
Cancel = -1 'True
Caption = "退 出"
Height = 495
Left = 2880
Style = 1 'Graphical
TabIndex = 4
Top = 3240
Width = 1215
End
Begin VB.TextBox txtpwd
BackColor = &H8000000F&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
MaxLength = 16
PasswordChar = "*"
TabIndex = 3
Top = 2640
Width = 2415
End
Begin VB.TextBox txtname
BackColor = &H8000000F&
BeginProperty Font
Name = "新宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
MaxLength = 10
TabIndex = 1
Top = 2160
Width = 2415
End
Begin VB.Label Label4
Caption = "口 令:"
ForeColor = &H00800000&
Height = 255
Left = 600
TabIndex = 2
Top = 2700
Width = 855
End
Begin VB.Label Label3
Caption = "帳 號:"
ForeColor = &H00800000&
Height = 255
Left = 600
TabIndex = 0
Top = 2280
Width = 855
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim fPath As String
Dim cnn As Object
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Static i As Integer '定義靜態變量
i = i + 1
If i > 3 Then
MsgBox "對不起,您已經輸入三次,關閉程序"
End
End If
rs.MoveFirst
Do While Not rs.EOF '循環查詢用戶名和密碼
If Trim(txtname.Text) = Trim(rs.Fields("Account").Value) And Trim(txtpwd.Text) = Trim(rs.Fields("Password").Value) Then
If Trim(rs.Fields("Isdeleted").Value) = True Then '檢測用戶權限
usertype = True
ElseIf Trim(rs.Fields("Isdeleted").Value) = False Then
usertype = False
frmmain.mnuUser.Visible = False
frmmain.Toolbar1.Buttons(4).Visible = False
frmmain.mnuPrice.Visible = False
End If
username = txtname.Text '記錄帳號名
pwd = txtpwd.Text
Unload Me
i = 0 '重新初始化i
frmmain.Show
Exit Sub
End If
rs.MoveNext
Loop
MsgBox "用戶名或密碼錯誤,請出新輸入!", , "錯誤信息"
txtname.SelStart = 0
txtname.SelLength = Len(txtname)
txtname.SetFocus
txtpwd.Text = ""
End Sub
Private Sub Form_Load()
showflash
Dim msg As Integer '如果數據庫中沒有蓋數據庫,則給與創建
Dim str1 As String
Dim str2 As String
str1 = LoadResString(101) '創建數據庫
str2 = LoadResString(102) '所需要創建表
Set cnn = New ADODB.Connection
cnn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False"
cnn.Execute str1
cnn.Execute str2
cnn.Close
'如果沒有記錄,則創建并打開數據庫聯接
con.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書銷售系統"
Set rs = New ADODB.Recordset
rs.Open "select * from Operator", con
If rs.EOF And rs.BOF Then
con.Execute "insert into Operator values('liunis','liunis','000000','1')"
End If
End Sub
Sub showflash()
fPath = App.Path & "\Temp_login"
Dim lpbits() As Byte
lpbits = LoadResData(101, "FLASH")
Open fPath For Binary As #1
Put #1, , lpbits
Close 1
ShockwaveFlash1.Movie = fPath
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cnn = Nothing
Kill fPath
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -