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

📄 moddownload.bas

📁 在线升级的例子 在线升级的例子
💻 BAS
字号:
Attribute VB_Name = "modDownload"
'/**********************************************************************
'  在线升级程序,海阔天空
'  Play78.com : 网站导航,源码之家,绝对开源
'  海阔天空收集整理
'  http://www.play78.com/
'  e-mail:hglai@eyou.com
' **********************************************************************

Option Explicit

Global strSvrURL As String
Global Url As String
Global RESUMEFILE As Boolean
Global FilePathName As String
Global Filename As String
Global FileLength As Single
Global Sec%, Min%, Hr%
Public Const SW_NORMAL = 1
Public strFormLoaded As String
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOW = 5

Public Function File_ByteConversion(NumberOfBytes As Single) As String
On Error Resume Next
    If NumberOfBytes < 1024 Then
        File_ByteConversion = NumberOfBytes & " Bytes"
    
    End If
    
    If NumberOfBytes > 1024 Then
        File_ByteConversion = Format(NumberOfBytes / 1024, "0.00") & " KB"
    
    End If
    
    If NumberOfBytes > 1024000 Then
        File_ByteConversion = Format(NumberOfBytes / 1024000, "###,###,##0.00") & " MB"
    
    End If
    
End Function

Public Function UpdateProgress(pb As Control, ByVal Percent)
    Dim Num$
    If Not pb.AutoRedraw Then
        pb.AutoRedraw = -1
    End If
    
    pb.Cls
    pb.ScaleWidth = 100
    pb.DrawMode = 10
    Num$ = Format$(Percent, "###") + "%"
    pb.CurrentX = 50 - pb.TextWidth(Num$) / 2
    pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(Num$)) / 2
    pb.Print Num$
    pb.Line (0, 0)-(Percent, pb.ScaleHeight), , BF
    pb.Refresh
    
End Function

Public Function FileCheck(Path$) As Boolean

    FileCheck = True
    On Error Resume Next
    Dim Disregard As Long
    Disregard = FileLen(Path)
        If Err <> 0 Then
            FileCheck = False
        End If
    
End Function

Public Function GETDATAHEAD(Data As Variant, ToRetrieve As String)
    On Error Resume Next
        If Data = "" Then Exit Function
        Dim EndBYTES%, a$, LENGTHEND%, PART%, Part2%, RetrieveLength%
            If InStr(Data, ToRetrieve) > 0 Then
                LENGTHEND = Len(Data)
                PART = InStr(Data, ToRetrieve)
                RetrieveLength = Len(ToRetrieve)
                a = Right(Data, LENGTHEND - PART - RetrieveLength)
                LENGTHEND = Len(a)
                If InStr(a, vbCrLf) > 0 Then
                Part2 = InStr(a, vbCrLf)
                a = Left(a, Part2 - 1)
            End If
            
        GETDATAHEAD = a
        
        End If
End Function

Public Function OpenIt(Frm As Form, ToOpen As String)
    ShellExecute Frm.hWnd, "Open", ToOpen, &O0, &O0, SW_NORMAL

End Function


⌨️ 快捷键说明

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