Option Explicit Dim arr() As Byte Dim l As Long Dim k As Long Dim i As Long Dim m As LongPrivate Sub Command1_Click() Open "C:\1.CHM" For Binary As #1 l = LOF(1) k = Int(l / 1024) m = l Mod 1024 If k > 0 Then ReDim arr(1023) For i = 1 To k Get #1, 1 + (i - 1) * 1024, arr ' 发送ARR ... DoEvents Next End If
If i = 0 Then i = 1 If m > 0 Then ReDim arr(m - 1) Get #1, 1 + (i - 1) * 1024, arr ' 发送ARR ... End If Close #1
Dim arr() As Byte
Dim l As Long
Dim k As Long
Dim i As Long
Dim m As LongPrivate Sub Command1_Click()
Open "C:\1.CHM" For Binary As #1
l = LOF(1)
k = Int(l / 1024)
m = l Mod 1024
If k > 0 Then
ReDim arr(1023)
For i = 1 To k
Get #1, 1 + (i - 1) * 1024, arr
' 发送ARR ...
DoEvents
Next
End If
If i = 0 Then i = 1
If m > 0 Then
ReDim arr(m - 1)
Get #1, 1 + (i - 1) * 1024, arr
' 发送ARR ...
End If
Close #1
End Sub
谢谢:):)
[email protected]
[email protected]