⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 用VB6制作的在线升级程序,仅供参考,各位爱好者可以在源码基础上进行完善
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "请点击升级进行程序"
   ClientHeight    =   1140
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4500
   LinkTopic       =   "Form1"
   ScaleHeight     =   1140
   ScaleWidth      =   4500
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "升级"
      Height          =   525
      Left            =   1380
      TabIndex        =   0
      Top             =   570
      Width           =   1245
   End
End
Attribute VB_Name = "frmMain"
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()
  
  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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -