用VB6.0编写自我升级的程序(一)(3)
中华网科技 http://tech.china.com
2005-06-20 13:38:17
|
|
|
Private Sub Form_Load()
If App.PrevInstance Then End
UpdateIniPath = App.Path & "Update.ini"
‘ 记录主程序的名字
WritePrivateProfileString "Main", "Name", App.EXEName, UpdateIniPath
‘ 记录运行状态
WritePrivateProfileString "Main", "Active", "-1", UpdateIniPath
‘ 记录更新次数
WritePrivateProfileString "Update", "Num", "0", UpdateIniPath
Me.Caption = App.EXEName
End Sub
Private Sub Form_Unload(Cancel As Integer)
‘ 记录运行状态
WritePrivateProfileString "Main", "Active", "0", UpdateIniPath
End Sub
用记事本打开modCommon.bas文件,copy以下内容到其中:
Attribute VB_Name = "modCommon"
Option Explicit
‘ ------------------------------------------
‘ 升级程序的例子
‘ 作者: 谢家峰
‘ 日期: 2003/12/19
‘
首页 上页 | 1 | 2 | 3 | 4 | 5 | 下页 尾页 共 5 页 |