?? form1.frm
字號:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1680
ClientLeft = 60
ClientTop = 345
ClientWidth = 4875
LinkTopic = "Form1"
ScaleHeight = 1680
ScaleWidth = 4875
StartUpPosition = 3 'Windows Default
Begin MSComDlg.CommonDialog CDialog2
Left = 4320
Top = 1200
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSComDlg.CommonDialog CDialog1
Left = 4320
Top = 480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdRestore
Caption = "導入"
Height = 375
Left = 3480
TabIndex = 8
Top = 1200
Width = 615
End
Begin VB.CommandButton cmdSave
Caption = "導出"
Height = 375
Left = 2640
TabIndex = 7
Top = 1200
Width = 615
End
Begin VB.CommandButton txtDelete
Caption = "刪除"
Height = 375
Left = 1800
TabIndex = 6
Top = 1200
Width = 615
End
Begin VB.CommandButton txtShow
Caption = "讀取"
Height = 375
Left = 960
TabIndex = 5
Top = 1200
Width = 615
End
Begin VB.CommandButton cndSet
Caption = "設置"
Height = 375
Left = 120
TabIndex = 4
Top = 1200
Width = 615
End
Begin VB.TextBox txtCompany
Height = 285
Left = 720
TabIndex = 3
Top = 720
Width = 3375
End
Begin VB.TextBox txtName
Height = 285
Left = 720
TabIndex = 2
Top = 240
Width = 3375
End
Begin VB.Label Label2
Caption = "公司:"
Height = 495
Left = 120
TabIndex = 1
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "姓名:"
Height = 375
Left = 120
TabIndex = 0
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cndSet_Click()
If txtName.Text = "" Then
MsgBox "請輸入名字"
Exit Sub
End If
If txtCompany.Text = "" Then
MsgBox "請輸入公司名稱"
Exit Sub
End If
If SetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "username", txtName.Text, REG_SZ) And SetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "companyname", txtCompany.Text, REG_SZ) Then
Else
MsgBox "設置失敗"
Exit Sub
End If
MsgBox "設置成功!"
txtName.Text = ""
txtCompany.Text = ""
End Sub
Private Sub cmdRestore_Click()
CDialog2.ShowOpen
If CDialog2.FileName = "" Then Exit Sub
If RestoreKey(KeyRoot.HKEY_CURRENT_USER, "Info", CDialog2.FileName) Then
MsgBox "導入成功"
txtName.Text = GetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "username", REG_SZ)
txtCompany.Text = GetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "companyname", REG_SZ)
Else
MsgBox "導入失敗"
Exit Sub
End If
End Sub
Private Sub cmdSave_Click()
CDialog1.ShowSave
If CDialog1.FileName = "" Then Exit Sub
If SaveKey(KeyRoot.HKEY_CURRENT_USER, "Info", CDialog1.FileName) Then
MsgBox "導出成功"
Else
MsgBox "導出出錯"
Exit Sub
End If
End Sub
Private Sub txtDelete_Click()
If DeleteKey(KeyRoot.HKEY_CURRENT_USER, "Info", "username") And DeleteKey(KeyRoot.HKEY_CURRENT_USER, "Info", "companyname") Then
MsgBox "刪除成功"
Else
MsgBox "刪除失敗"
Exit Sub
End If
txtName.Text = ""
txtCompany.Text = ""
End Sub
Private Sub txtShow_Click()
Dim name As String
Dim company As String
txtName.Text = GetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "username", REG_SZ)
txtCompany.Text = GetKeyValue(KeyRoot.HKEY_CURRENT_USER, "Info", "companyname", REG_SZ)
MsgBox "讀取成功"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -