Sub MySub(Destination As String, UseFTP As Boolean) As ResumableSub
Dim success As Boolean = False
If UseFTP Then
Dim ftp As FTP
ftp.Initialize("FTP", "xxx.xxx.xxx.xxx", 21, "user", "password")
wait for (ftp.UploadFile("dirSource", "fileSource", True, Destination&"/fileSource")) FTP_UploadCompleted (ServerPath As String, succ As Boolean)
success = succ
Else
File.Copy("dirSource", "fileSource", Destination, "fileTarget")
If File.Exists("dirSource", "fileSource") Then success = True
End If
Return success
End Sub