Article ID: 200676
Article Last Modified on 8/10/2004
Option Explicit
Private Sub Command1_Click()
' Use the AsyncRead method to copy the file.
UserControl.AsyncRead Text1.Text, vbAsyncTypeFile
End Sub
Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
' Yield execution to ensure that the temporary file is written.
DoEvents
' Display the copied file name, including its path,
' using the value property of the AsyncProp object.
MsgBox Text1.Text & " was copied to: " & AsyncProp.Value
End Sub
Private Sub UserControl_AsyncReadProgress(AsyncProp As AsyncProperty)
' Display the progress of the file copy using the
' BytesRead and BytesMax properties of the AsyncProp object.
Label2.Caption = AsyncProp.BytesRead & " of " & AsyncProp.BytesMax & " bytes copied."
End Sub
Private Sub UserControl_Initialize()
Command1.Caption = "Copy!"
Label1.Caption = "From:"
Label2.Caption = ""
' Assign a file to be copied.
' Use the Visual Basic 6.0 run-time files package as a test.
Text1.Text = "http://download.microsoft.com/download/vb60pro/install/6/Win98Me/EN-US/VBRun60.exe"
End Sub
Keywords: kbhowto kbdownload kbcodesnippet kbctrl KB200676