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

📄 frmupdate.frm

📁 VB仿LiveUpdate自动更新程序.比较实用的一个功能
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmLiveUpdate 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "LiveUpdate"
   ClientHeight    =   4140
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6930
   Icon            =   "frmUpdate.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4140
   ScaleWidth      =   6930
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdConfig 
      Caption         =   "配置 ..."
      Height          =   375
      Left            =   5640
      TabIndex        =   13
      Top             =   1080
      Width           =   1215
   End
   Begin VB.Frame frmTransfert 
      Caption         =   "进度"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1335
      Left            =   2400
      TabIndex        =   7
      Top             =   1680
      Visible         =   0   'False
      Width           =   4455
      Begin VB.Label Lbl_Averages 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         ForeColor       =   &H80000002&
         Height          =   255
         Left            =   2160
         TabIndex        =   12
         Top             =   240
         Width           =   2055
      End
      Begin VB.Label txtPercent 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   11
         Top             =   525
         Width           =   4215
      End
      Begin VB.Label Lbl_FileSize 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         ForeColor       =   &H80000002&
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   255
         Width           =   1935
      End
      Begin VB.Label Percent 
         Alignment       =   2  'Center
         BackColor       =   &H8000000D&
         ForeColor       =   &H8000000E&
         Height          =   315
         Left            =   140
         TabIndex        =   9
         Top             =   560
         Width           =   15
      End
      Begin VB.Label lbl_Time 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         ForeColor       =   &H80000002&
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   960
         Width           =   3735
      End
   End
   Begin VB.Timer Timer 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   480
      Top             =   360
   End
   Begin VB.CommandButton cmdNext 
      Caption         =   "> 下一步(&N)"
      Height          =   375
      Left            =   1575
      TabIndex        =   0
      Top             =   3720
      Width           =   1335
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   5520
      TabIndex        =   1
      Top             =   3720
      Width           =   1335
   End
   Begin VB.CommandButton cmdBack 
      Caption         =   "< 上一步(&B)"
      Enabled         =   0   'False
      Height          =   375
      Left            =   120
      TabIndex        =   3
      TabStop         =   0   'False
      Top             =   3720
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Height          =   120
      Left            =   120
      TabIndex        =   2
      Top             =   3480
      Width           =   6735
   End
   Begin VB.Image imgLogo 
      BorderStyle     =   1  'Fixed Single
      Height          =   3270
      Left            =   120
      Picture         =   "frmUpdate.frx":0442
      Stretch         =   -1  'True
      Top             =   120
      Width           =   2175
   End
   Begin VB.Label lblEnd 
      Height          =   255
      Left            =   2520
      TabIndex        =   6
      Top             =   3200
      Width           =   4335
   End
   Begin VB.Label lblInfo 
      Height          =   855
      Left            =   2520
      TabIndex        =   5
      Top             =   720
      Width           =   4335
   End
   Begin VB.Label lblCaption 
      Caption         =   "CodeFans.net"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2520
      TabIndex        =   4
      Top             =   240
      Width           =   4215
   End
End
Attribute VB_Name = "frmLiveUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
'Option Explicit
Dim intStep As Integer
Dim hOpen As Long, hConnection As Long
Dim AppName As String
Dim blnNewUpdate As Boolean
Dim InProgress As Boolean

Private Sub cmdBack_Click()
  intStep = intStep - 1
  If GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "SEECONFIG") = 1 Then
     If intStep = 1 Then
        Me.cmdConfig.Visible = True
     Else
        Me.cmdConfig.Visible = False
     End If
  End If
  Step (intStep)
End Sub

Private Sub cmdCancel_Click()
  If InProgress = True Then
     If MsgBox("您真的想取消更新 ?", vbYesNo + vbDefaultButton2, "LiveUpdate") = vbYes Then
        StopTransfert = True
        frmTransfert.Visible = False
        'Unload Me
     End If
  Else
     Unload Me
  End If
     
End Sub

Private Sub cmdConfig_Click()
  frmFTPAdd.Show vbModal
End Sub

Private Sub cmdNext_Click()
If GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "SEECONFIG") = 1 Then
   If intStep >= 1 Then
      Me.cmdConfig.Visible = False
   Else
      Me.cmdConfig.Visible = True
   End If
End If

  If Me.cmdNext.Caption = "完成" Then
     If blnNewUpdate = True Then
        Dim intExecute As Integer
        Dim strExecute As String
        intExecute = GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "EXECUTE")
        strExecute = GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "EXECFILES")
        If intExecute = 1 And Dir(strExecute) <> "" Then
           Call Shell(strExecute, vbNormalFocus)
        End If
     End If
     
     Unload Me
  Else
     intStep = intStep + 1
     Step (intStep)
  End If
End Sub

Private Sub Form_Load()
  If GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "SEECONFIG") = 0 Then Me.cmdConfig.Visible = False
  AppName = GetIniParam(App.Path & "\LiveUpdate.ini", "LiveUpdate", "APPNAME")
  intStep = intStep + 1
  Step (intStep)
  frmLiveUpdate.Caption = "LiveUpdate " & AppName
End Sub

⌨️ 快捷键说明

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