Dim MyF, MyFF
Dim A(1023) As Byte
MyF = FreeFile
Open "E:\2.bmp" For Binary As #MyF
MyFF = FreeFile
Open "e:\1.bmp" For Binary As #MyFF
Do Until EOF(MyFF)
Get #MyFF, , A
Put #MyF, , A
Loop
Close #MyF
Close #MyFF
MsgBox "Ãîòîâî!!", vbInformation, "Ãîòîâî!"
End
Dim MyF, MyFF
Dim A As Byte
MyF = FreeFile
Open "E:\2.bmp" For Binary As #MyF
MyFF = FreeFile
Open "e:\1.bmp" For Binary As #MyFF
Do
Get #MyFF, , A
If EOF(MyFF) Then Exit Do
Put #MyF, , A
Loop
Close #MyF
Close #MyFF
MsgBox "Ãîòîâî!!", vbInformation, "Ãîòîâî!"
End
Sub AppendSmall(ByVal srcPath As String, ByVal dstPath As String)
Dim src As Integer
Dim dst As Integer
Dim buf() As Byte
If FileLen(srcPath) = 0 Then Exit Sub
src = FreeFile
Open srcPath For Binary Access Read Lock Read As #src
ReDim buf(LOF(src) - 1)
Get src, , buf
Close #src
dst = FreeFile
Open dstPath For Binary Access Write Lock Write As #dst
Put #dst, LOF(dst) + 1, buf
Close #dst
End Sub
Const DEFAULT_BUFSIZE = 4096
Function Min(ByVal a As Long, ByVal b As Long) As Long
If a < b Then Min = a Else Min = b
End Function
Sub AppendBig(ByVal srcPath As String, ByVal dstPath As String, Optional ByVal bufSize As Long = DEFAULT_BUFSIZE)
Dim src As Integer
Dim dst As Integer
Dim buf() As Byte
Dim srcSize As Long
If FileLen(srcPath) = 0 Then Exit Sub
src = FreeFile
Open srcPath For Binary Access Read Lock Read As #src
srcSize = LOF(src)
dst = FreeFile
Open dstPath For Binary Access Write Lock Write As #dst
Seek #dst, LOF(dst) + 1
If bufSize <= 0 Then bufSize = DEFAULT_BUFSIZE
bufSize = Min(bufSize, srcSize)
Do
ReDim buf(bufSize - 1)
Get #src, , buf
Put #dst, , buf
bufSize = Min(bufSize, srcSize - Loc(src))
Loop While bufSize > 0
Close #src
Close #dst
End Sub
ReDim A(FileLen(App.Path & "\2.jpg") - 1) As Byte
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.