专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »VB教程 » vb6.0教程:用VB6.0编写自我升级的程序(二)-vb教程 »正文

vb6.0教程:用VB6.0编写自我升级的程序(二)-vb教程

来源: 发布时间:星期四, 2009年2月12日 浏览:230次 评论:0


ss=MsoNormal style=\"MARGIN: 0cm 0cm 0pt\"> prefix = o ns = \"urn:schemas-microsoft-com:office:office\" /> 2、 projNewMain.vbp工程:

介绍说明:这个是新即升级后由于我目前没有服务器故将该放在projUpdate.vbp工程资源文件中在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



´ ------------------------------------------

´ 升级例子

´ 作者: 谢家峰

´ 日期: prefix = st1 ns = \"urn:schemas-microsoft-com:office:smarttags\" />2003/12/19

´

´ 这里是升级后

´

´ ------------------------------------------





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 \"Main\", \"Active\", \"-1\", UpdateIniPath



Me.Caption = App.EXEName



End Sub



Private Sub Form_Unload(Cancel As Integer)

´ 记录运行状态

WritePrivateProfileString \"Main\", \"Active\", \"0\", UpdateIniPath

End Sub





3、 projUpdate.vbp工程:

介绍说明:这是升级含有个资源文件



用记事本打开frmUpdate.frm文件copy以下内容到其中:




0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: