📄 frmconfigurar.frm
字号:
PasswordChar = "*"
TabIndex = 2
Top = 2460
Width = 1995
End
Begin VB.Label Label1
Caption = "请输入以下信息,以便和pop3服务器建立联系:"
Height = 495
Index = 3
Left = 720
TabIndex = 19
Top = 360
Width = 4635
End
Begin VB.Label Label1
Caption = "请输入pop3服务器名或IP地址"
Height = 375
Index = 0
Left = 360
TabIndex = 12
Top = 1200
Width = 2235
End
Begin VB.Label Label1
Caption = "请输入邮箱地址"
Height = 195
Index = 1
Left = 360
TabIndex = 11
Top = 1860
Width = 1935
End
Begin VB.Label Label1
Caption = "请输入密码"
Height = 195
Index = 2
Left = 360
TabIndex = 10
Top = 2520
Width = 1635
End
End
Begin ComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 29
Top = 5985
Width = 8145
_ExtentX = 14367
_ExtentY = 873
SimpleText = ""
_Version = 327682
BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
NumPanels = 3
BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Object.Width = 4410
MinWidth = 4410
Text = "邮件自动处理系统欢迎您"
TextSave = "邮件自动处理系统欢迎您"
Object.Tag = ""
EndProperty
BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Style = 6
Alignment = 2
AutoSize = 1
Object.Width = 7303
TextSave = "2006-6-13"
Object.Tag = ""
EndProperty
BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Style = 5
Alignment = 2
TextSave = "19:43"
Object.Tag = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmConfigurar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Configure e-checker
Option Explicit
'Read program settings
Private Sub LeerSeteos()
txtPop3Host = pop3Host
txtPop3User = pop3User
txtPop3Passwd = pop3Passwd
txtInterval = Interval
txtProgram = EmailProgram
'txtArguments = Arguments
txtTimeout = Timeout
txtSound = Sound
End Sub
'Save the settings
Private Sub GuardarSeteos()
pop3Host = txtPop3Host
pop3User = txtPop3User
pop3Passwd = txtPop3Passwd
Interval = txtInterval
EmailProgram = txtProgram
'Arguments = txtArguments
Timeout = txtTimeout
Sound = txtSound
SaveSetting App.EXEName, "Config", "Host", pop3Host
SaveSetting App.EXEName, "Config", "User", pop3User
SaveSetting App.EXEName, "Config", "Passwd", pop3Passwd
SaveSetting App.EXEName, "Config", "Interval", Interval
SaveSetting App.EXEName, "Config", "Program", EmailProgram
SaveSetting App.EXEName, "Config", "Arguments", Arguments
SaveSetting App.EXEName, "Config", "Timeout", Timeout
SaveSetting App.EXEName, "Config", "Sound", Sound
End Sub
'Check field completeness
Private Function TodoOk() As Boolean
'POP3 Host
If txtPop3Host = "" Then
MsgBox LoadResString(Language + 70), vbExclamation
txtPop3Host.SetFocus
fraBTN(1).Visible = True
fraBTN(1).ZOrder (0)
Exit Function
End If
'POP3 User
If txtPop3User = "" Then
MsgBox LoadResString(Language + 71), vbExclamation
txtPop3User.SetFocus
fraBTN(1).Visible = True
fraBTN(1).ZOrder (0)
Exit Function
End If
'No password check
'Check interval
If Val(txtInterval) = 0 Then
MsgBox LoadResString(Language + 72), vbExclamation
txtInterval.SetFocus
fraBTN(2).Visible = True
fraBTN(2).ZOrder (0)
Exit Function
End If
'Check timeout
If Val(txtTimeout) = 0 Then
MsgBox LoadResString(Language + 73), vbExclamation
txtTimeout.SetFocus
fraBTN(2).Visible = True
fraBTN(2).ZOrder (0)
Exit Function
End If
TodoOk = True
End Function
Private Sub Aceprar_Click()
If TodoOk() Then
GuardarSeteos
Unload Me
End If
End Sub
'Browse button
Private Sub cmdBrowse_Click(Index As Integer)
Dim ofn As OPENFILENAME
Dim rtn As String
ofn.lStructSize = Len(ofn)
ofn.hwndOwner = Me.hwnd
ofn.hInstance = App.hInstance
ofn.flags = OFNFileMustExist + OFNHideReadOnly + OFNPathMustExist
'Browse for e-mail program
If Index = 0 Then
ofn.lpstrFilter = LoadResString(Language + 74) + Chr(0)
ofn.lpstrFile = Space(254) + Chr(0)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space(254) + Chr(0)
ofn.nMaxFileTitle = 255
ofn.lpstrInitialDir = "c:\" + Chr(0)
ofn.lpstrTitle = LoadResString(Language + 75) + Chr(0)
rtn = GetOpenFileName(ofn)
If rtn >= 1 Then
txtProgram.Text = ofn.lpstrFile
End If
Else 'browse for sound
ofn.lpstrFilter = LoadResString(Language + 76) + Chr(0) + "*.wav" + Chr(0)
ofn.lpstrFile = Space(254) + Chr(0)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space(254) + Chr(0)
ofn.nMaxFileTitle = 255
ofn.lpstrInitialDir = App.Path + Chr(0)
ofn.lpstrTitle = LoadResString(Language + 77) + Chr(0)
rtn = GetOpenFileName(ofn)
If rtn >= 1 Then
txtSound.Text = ofn.lpstrFile
End If
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If TodoOk() Then
GuardarSeteos
Unload Me
End If
End Sub
'Activates the corresponding frame
Private Sub optBTN_Click(Index As Integer)
Dim i As Integer
fraBTN(Index).Visible = True
For i = 1 To 3
If i <> Index Then fraBTN(i).Visible = False
Next
Select Case Index
Case 1
txtPop3Host.SetFocus
Case 2
txtInterval.SetFocus
Case 3
txtProgram.SetFocus
End Select
End Sub
Private Sub Form_Load()
Dim i As Integer
cmdBrowse(1).Enabled = HasSound()
txtSound.Enabled = HasSound
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
LeerSeteos
fraBTN(1).Visible = True
fraBTN(1).ZOrder (0)
End Sub
Private Sub txtInterval_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> vbKeyBack Then
KeyAscii = 0
End If
End Sub
Private Sub txtTimeout_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> vbKeyBack Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -