?? frmcompany.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmCompany
BorderStyle = 3 'Fixed Dialog
Caption = "公司信息"
ClientHeight = 2940
ClientLeft = 45
ClientTop = 435
ClientWidth = 3300
Icon = "frmCompany.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2940
ScaleWidth = 3300
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin MSAdodcLib.Adodc AdodcCaller
Height = 330
Left = 840
Top = 2760
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton cmdQuit
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 5
Top = 2280
Width = 735
End
Begin VB.CommandButton cmdOK
Caption = "確認"
Default = -1 'True
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 4
Top = 2280
Width = 735
End
Begin VB.CommandButton cmdClear
Caption = "清除"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 6
Top = 2280
Width = 735
End
Begin VB.TextBox txtConfirm
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 6
PasswordChar = "*"
TabIndex = 3
Top = 1680
Width = 1455
End
Begin VB.TextBox txtMb
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
MaxLength = 11
TabIndex = 1
Top = 720
Width = 1455
End
Begin VB.TextBox txtPassword
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 6
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 1455
End
Begin VB.TextBox txtCompany
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
MaxLength = 10
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "確認密碼"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 10
Top = 1800
Width = 975
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "總裁手機"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 9
Top = 840
Width = 975
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "手機密碼"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 8
Top = 1320
Width = 975
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "公司簡稱"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 7
Top = 360
Width = 975
End
End
Attribute VB_Name = "frmCompany"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClear_Click()
txtCompany.Text = ""
txtMb.Text = ""
txtPassword.Text = ""
txtConfirm.Text = ""
End Sub
Private Sub cmdOK_Click()
Dim I As Integer
Dim nLen As Integer
Dim nTmp As Integer
Dim lTmp As Long
Dim strTmp As String
On Error Resume Next 'CallerID
nLen = Len(Trim(txtCompany.Text))
If nLen < 2 Then
MsgBox "公司簡稱至少兩個漢字!", vbQuestion + vbOKOnly, "提示"
txtCompany.SetFocus
Exit Sub
End If
For I = 1 To nLen
strTmp = Mid(txtCompany.Text, I, 1)
If (AscW(strTmp) \ &H100 = 0) And (AscW(strTmp) > 0) Then
MsgBox "公司簡稱必須全部為漢字!", vbQuestion + vbOKOnly, "提示"
Exit Sub
End If
Next I
If CheckMb(txtMb.Text) = False Then
MsgBox "手機號碼輸入錯誤!", vbQuestion + vbOKOnly, "提示"
txtMb.SetFocus
Exit Sub
End If
If (Trim(txtPassword.Text)) <> Trim(txtConfirm.Text) Then
MsgBox "手機密碼與確認密碼應一致!", vbQuestion + vbOKOnly, "提示"
txtPassword.SetFocus
Exit Sub
End If
If Len(Trim(txtPassword.Text)) < 4 Then
MsgBox "手機密碼位數應大于4!", vbQuestion + vbOKOnly, "提示"
txtPassword.SetFocus
Exit Sub
End If
If CheckLegalChars(txtPassword.Text, ALL_CHAR_SET) = False Then
MsgBox "密碼必須取數字或字母!", vbQuestion + vbOKOnly, "提示"
txtPassword.SetFocus
Exit Sub
End If
With AdodcCaller.Recordset
If .RecordCount < 1 Then
.AddNew
Else
.MoveFirst
End If
![Corp] = txtCompany.Text
![Mb] = txtMb.Text
![Password] = Base64_Encode(txtPassword.Text)
.Update
strCorpName = ![Corp]
strMb = ![Mb]
strMbPass = txtPassword.Text
.Requery
End With
frmMain.GetCorpInfo
MsgBox "公司信息寫入成功!", vbInformation + vbOKOnly, "提示"
End Sub
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next 'CallerID
With AdodcCaller
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
strDataPath + ";Persist Security Info=False"
.CommandType = adCmdUnknown
.RecordSource = "select * from Company"
.Refresh
With .Recordset
If .RecordCount > 0 Then
.MoveFirst
txtCompany.Text = ![Corp]
txtMb.Text = ![Mb]
txtPassword.Text = Base64_Decode(![Password])
txtConfirm.Text = txtPassword.Text
End If
End With
End With
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -