📄 frmcanshu.frm
字号:
VERSION 5.00
Begin VB.Form frmCanshu
BackColor = &H00F6F6F6&
BorderStyle = 3 'Fixed Dialog
Caption = "参数设置"
ClientHeight = 3390
ClientLeft = 45
ClientTop = 435
ClientWidth = 4680
Icon = "frmCanshu.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3390
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CheckBox Check1
Appearance = 0 'Flat
BackColor = &H00F6F6F6&
Caption = "进入系统时进行身份验证"
ForeColor = &H80000008&
Height = 255
Left = 1080
TabIndex = 8
Top = 1440
Width = 2775
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 7
Top = 960
Width = 2775
End
Begin VB.TextBox txtuser
Appearance = 0 'Flat
Height = 270
Left = 1080
TabIndex = 6
Top = 360
Width = 2775
End
Begin VB.ComboBox cmbYinyue
Appearance = 0 'Flat
BackColor = &H8000000E&
ForeColor = &H80000007&
Height = 300
ItemData = "frmCanshu.frx":030A
Left = 1320
List = "frmCanshu.frx":0323
Style = 2 'Dropdown List
TabIndex = 5
Top = 1920
Width = 1875
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 720
TabIndex = 1
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 0
Top = 2640
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "背景音乐:"
Height = 255
Left = 360
TabIndex = 4
Top = 1920
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码:"
Height = 255
Left = 360
TabIndex = 3
Top = 960
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户名:"
Height = 255
Left = 360
TabIndex = 2
Top = 360
Width = 855
End
End
Attribute VB_Name = "frmCanshu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
con.Open
Dim sql As String
sql = "select * from sys where setname='sound'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
If cmbYinyue.Text = "随机播放" Then
rs("setvalue") = "auto"
Dim i As Integer
i = CInt(Second(Time()))
i = (i Mod 5)
m_MidiFile1 = App.Path + "\bgsound\beijing" + CStr(i) + ".mid"
PlayMidiFile m_MidiFile1
fMainForm.Timer1.Enabled = True
Else
If cmbYinyue.ListIndex <= 4 Then
rs("setvalue") = CStr(cmbYinyue.ListIndex)
PlayMidiFile App.Path + "\bgsound\beijing" + CStr(cmbYinyue.ListIndex) + ".mid"
fMainForm.Timer1.Enabled = True
Else
rs("setvalue") = "-1"
StopMidiFile
End If
End If
rs.Update
rs.Close
sql = "select * from sys where setname='pass'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
If Check1.Value = 1 Then
rs("setvalue") = "0"
Else
rs("setvalue") = "1"
End If
rs.Update
rs.Close
sql = "select * from sys where setname='password'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
rs("setvalue") = txtPassword.Text
rs.Update
rs.Close
sql = "select * from sys where setname='username'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
rs("setvalue") = txtuser.Text
rs.Update
rs.Close
con.Close
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
con.Open
Dim sql As String
sql = "select * from sys where setname='sound'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
If rs("setvalue") = "auto" Then
cmbYinyue.Text = "随机播放"
Else
If rs("setvalue") <> "-1" Then
cmbYinyue.ListIndex = CInt(rs("setvalue"))
Else
cmbYinyue.Text = "不播放音乐"
End If
End If
rs.Close
sql = "select * from sys where setname='pass'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
If rs("setvalue") <> "1" Then Check1.Value = 1
rs.Close
sql = "select * from sys where setname='password'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
txtPassword.Text = rs("setvalue")
rs.Close
sql = "select * from sys where setname='username'"
rs.Open sql, con, adOpenKeyset, adLockPessimistic
txtuser.Text = rs("setvalue")
rs.Close
con.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -