7,785
社区成员




Option Explicit
Sub AddLog(ByVal Text As String)
Dim hFile As Integer
Dim sFileName As String
sFileName = App.Path & "\" & App.EXEName & ".log"
hFile = FreeFile()
Open sFileName For Append Shared As #hFile
Print #hFile, Now(), Text
Close #hFile
End Sub
Private Sub Command1_Click()
AddLog "发送:" & Text1.Text
...
End Sub
Private Sub Form_Load()
AddLog "登录"
End Sub
Private Sub Form_Unload(Cancel As Integer)
AddLog "退出"
End Sub