📄 初始数据库设置.frm
字号:
VERSION 5.00
Begin VB.Form 初始数据库设置
Caption = "数据库设置"
ClientHeight = 4080
ClientLeft = 60
ClientTop = 450
ClientWidth = 4260
LinkTopic = "Form1"
ScaleHeight = 4080
ScaleWidth = 4260
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Height = 375
Left = 1920
TabIndex = 7
Top = 2280
Width = 2055
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 6
Text = "127.0.0.1"
Top = 480
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "重置(&R)"
Height = 495
Left = 1680
TabIndex = 5
Top = 3240
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 4
Top = 1680
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 3
Text = "sa"
Top = 1080
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "保存设置(&S)"
Height = 495
Left = 360
TabIndex = 2
Top = 3240
Width = 975
End
Begin VB.CommandButton Command3
Caption = "退出(&Q)"
Height = 495
Left = 3000
TabIndex = 1
Top = 3240
Width = 975
End
Begin VB.PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 720
Left = 120
Picture = "初始数据库设置.frx":0000
ScaleHeight = 720
ScaleWidth = 720
TabIndex = 0
Top = 120
Width = 720
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "如非确定,请勿更改数据库名称!"
Height = 180
Left = 840
TabIndex = 21
Top = 2880
Width = 2700
End
Begin VB.Label Label8
Caption = "Label8"
Height = 135
Left = 1440
TabIndex = 20
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label7
Caption = "Label7"
Height = 135
Left = 1080
TabIndex = 19
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label6
Caption = "Label5"
Height = 135
Left = 840
TabIndex = 18
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label5
Caption = "Label5"
Height = 135
Left = 600
TabIndex = 17
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "数据库名称:"
Height = 180
Left = 840
TabIndex = 16
Top = 2400
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "数据库IP:"
Height = 180
Left = 840
TabIndex = 15
Top = 600
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "数据库密码:"
Height = 180
Left = 840
TabIndex = 14
Top = 1800
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "管理员用户:"
Height = 180
Left = 840
TabIndex = 13
Top = 1200
Width = 1080
End
Begin VB.Label Label9
Caption = "Label9"
Height = 135
Left = 1800
TabIndex = 12
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label10
Caption = "Label10"
Height = 135
Left = 2280
TabIndex = 11
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label11
Caption = "Label11"
Height = 135
Left = 2640
TabIndex = 10
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label12
Caption = "Label12"
Height = 135
Left = 3120
TabIndex = 9
Top = 3840
Visible = 0 'False
Width = 135
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "数据库在本机请设置IP为127.0.0.1 !"
Height = 180
Left = 960
TabIndex = 8
Top = 120
Width = 3060
End
End
Attribute VB_Name = "初始数据库设置"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Text1.Text = "sa"
Text2.Text = ""
Text3.Text = "127.0.0.1"
Text4.Text = ""
End Sub
Private Sub Command1_Click() '确定向database.ini写入信息
Dim a As String
Dim B
If Text1.Text = "" Then
B = MsgBox("管理员用户不能为空", 0 + 48, "警告")
Text1.SetFocus
ElseIf Text3.Text = "" Then
B = MsgBox("数据库IP不能为空", 0 + 48, "警告")
Text3.SetFocus
ElseIf Text4.Text = "" Then
B = MsgBox("数据库IP不能为空", 0 + 48, "警告")
Text4.SetFocus
Else
data_user = Text1.Text
data_pass = Text2.Text
data_ip = Text3.Text
data_name = Text4.Text
ClassIni.IniFileName = App.Path & "\Config\database.ini"
Label5.Caption = ClassIni.WriteString("Database", "user", data_user)
Label6.Caption = ClassIni.WriteString("Database", "password", data_pass)
Label7.Caption = ClassIni.WriteString("Database", "databaseip", data_ip)
Label8.Caption = ClassIni.WriteString("Database", "databasename", data_name)
If Label5.Caption = "True" And Label6.Caption = "True" And Label7.Caption = "True" And Label8.Caption = "True" Then
a = MsgBox("保存成功!", , "操作提示")
End If
End If
End Sub
Private Sub Command3_Click()
Unload Me
Call ShellExecute(Me.hwnd, "Open", App.Path & "\手机定位系统.exe", "", App.Path, 1)
End Sub
Private Sub Form_Load()
ClassIni.IniFileName = App.Path & "\Config\database.ini"
data_user = ClassIni.ReadString("Database", "user", 9999)
data_pass = ClassIni.ReadString("Database", "password", 9999)
data_ip = ClassIni.ReadString("Database", "databaseip", 9999)
data_name = ClassIni.ReadString("Database", "databasename", 9999)
Text1.Text = data_user
Text2.Text = data_pass
Text3.Text = data_ip
Text4.Text = data_name
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call ShellExecute(Me.hwnd, "Open", App.Path & "\手机定位系统.exe", "", App.Path, 1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -