![]() |
|
||||||||||||||
| | 网站首页 | 数据库教程 | web编程 | 服务器 | 程序设计 | | ||
|
||
|
||||||
| 用vb6.0编写自我升级的程序(二) | ||||||
作者:佚名 文章来源:不详 点击数: 更新时间:2007-7-1 ![]() |
||||||
|
说明:这个是新的主程序,即升级后的主程序,由于我目前没有服务器,故将该程序放在projUpdate.vbp工程的资源文件中。 用记事本打开frmNewMain.frm文件,copy以下内容到其中: VERSION 5.00 Begin VB.Form frmNewMain Appearance = 0 'Flat BackColor = &H80000005& Caption = "Form1" ClientHeight = 1365 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = "Form1" ScaleHeight = 1365 ScaleWidth = 4680 StartUpPosition = 3 '窗口缺省 Begin VB.CommandButton Command1 Caption = "升级" Height = 525 Left = 1410 TabIndex = 0 Top = 660 Width = 1245 End Begin VB.Label lblCap Caption = "告诉你,我已经升级了,没看出和以前不一样了吗?" Height = 255 Left = 120 TabIndex = 1 Top = 60 Width = 4275 End End Attribute VB_Name = "frmNewMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' ------------------------------------------ ' 升级程序的例子 ' 作者: 谢家峰 ' 日期: ' ' 这里是升级后的主程序 ' ' ------------------------------------------ Private Sub Command1_Click() Command1.Enabled = False ' 运行更新程序 Shell App.Path & "\update.exe", vbNormalFocus End Sub Private Sub Form_Load() Dim i As Integer If App.PrevInstance Then End UpdateIniPath = App.Path & "\Update.ini" ' 记录主程序的名字 WritePrivateProfileString "Main", "Name", App.EXEName, UpdateIniPath ' 记录运行状态 WritePrivateProfileString " Me.Caption = App.EXEName End Sub Private Sub Form_Unload(Cancel As Integer) ' 记录运行状态 WritePrivateProfileString " End Sub 三、 projUpdate.vbp工程: 说明:这是升级程序,含有一个资源文件。 用记事本打开frmUpdate.frm文件,copy以下内容到其中:
|
||||||
| 文章录入:admin 责任编辑:admin | ||||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | ||||||
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 网站地图 | 管理登录 | | |||
|