Gute Morgen zusammen und ein Frohes neues Jahr 
ich habe ein Problem bei der Implementierung einer Anzeige des Fortschritts beim Upload einer Datei.
Für den Upload selber habe ich ein Tool verwendet das eigene Klassen erstellt und diese sich dann in VS befinden. Diese heißen:
Durch diese Bibliotheken, kann ich einfache Funktionen verwenden. Da ich aber nicht die einfache Windows Funktion verwende
kann ich dann auch leider nicht auf den Parameter der Fortschrittanzeige zugreifen.
Nun ist die Frage, wie ich das am besten anstellen soll, dass mir eine Anzeige beim Upload angezeigt wird?!
Hier noch mein ganzer Code damit ihr Euch ein Bild machen könnt was ich gerade meine

ich habe ein Problem bei der Implementierung einer Anzeige des Fortschritts beim Upload einer Datei.
Für den Upload selber habe ich ein Tool verwendet das eigene Klassen erstellt und diese sich dann in VS befinden. Diese heißen:
Code:
Imports CHILKATCERTIFICATELib
Imports CHILKATFTP2Lib
Imports Chilkat
Durch diese Bibliotheken, kann ich einfache Funktionen verwenden. Da ich aber nicht die einfache Windows Funktion verwende
Code:
My.Computer.Network.UploadFile(parameter)
kann ich dann auch leider nicht auf den Parameter der Fortschrittanzeige zugreifen.
Nun ist die Frage, wie ich das am besten anstellen soll, dass mir eine Anzeige beim Upload angezeigt wird?!
Hier noch mein ganzer Code damit ihr Euch ein Bild machen könnt was ich gerade meine

Code:
Imports CHILKATCERTIFICATELib
Imports CHILKATFTP2Lib
Imports Chilkat
Imports MSWinsockLib
Imports System
Imports Microsoft
Imports System.Net
Imports Microsoft.Win32
Public Class Uploadvorgang
Dim ofd As New OpenFileDialog
Dim sfd As New SaveFileDialog
Dim ftp As New Chilkat.Ftp2()
Dim success As Boolean
Dim imagepfad As String
Dim dialog As New WIA.CommonDialog
Dim image As WIA.ImageFile = Nothing
Dim i As String
'Datum Formatierung
Dim datum As String
Public Event UploadProgressChanged As UploadProgressChangedEventHandler
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
upload()
fileExist()
End Sub
'################# Funktion Upload ####################
Private Function upload()
' Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")
If (success <> True) Then
MsgBox(ftp.LastErrorText)
Return (0)
Exit Function
End If
ftp.Hostname = "Die IP vom FTP Server"
ftp.Username = "Benutzer"
ftp.Password = "Passwort"
' The default data transfer mode is "Active" as opposed to "Passive".
' Connect and login to the FTP server.
success = ftp.Connect()
If (success <> True) Then
MsgBox(ftp.LastErrorText, MsgBoxStyle.Information)
Return (0)
Exit Function
End If
' Change to the remote directory where the file will be uploaded.
success = ftp.ChangeRemoteDir("Zielordner")
If (success <> True) Then
MsgBox(ftp.LastErrorText & vbCrLf & "Auch das muss die Fehlermeldung sein", MsgBoxStyle.Information)
Return (0)
Exit Function
End If
MsgBox("Legen Sie ein Dokument in Ihren Scanner.")
Try
Image = dialog.ShowAcquireImage(WIA.WiaDeviceType.ScannerDeviceType, , , , False, )
Catch ex As Exception
MsgBox("Ein Fehler ist aufgetreten! Überprüfen Sie ob das Gerät Eingeschaltet und angeschlossen ist." & Environment.NewLine & Environment.NewLine & ex.Message)
End
End Try
datum = FormatDateTime(Now, DateFormat.ShortTime)
datum = Replace(datum, " ", "_") ' leerzeichen durch unterstrich ersetzen
datum = Replace(datum, ".", "") ' Punkte entfernen
datum = Replace(datum, ":", "") ' Doppelpunkte entfernen
If Not Image Is Nothing Then
imagepfad = ("Quellordner")
If FileExists(imagepfad + "img_" + datum + ".jpg") Then
i = i + 1
image.SaveFile(imagepfad + "img_" + datum + "_" + i + ".jpg")
Else
image.SaveFile(imagepfad + "img_" + datum + ".jpg")
End If
Else
MsgBox("Es wurde kein Bild erfasst!", MsgBoxStyle.Information, "Information")
End
End If
ofd.InitialDirectory = "Quellordner"
ofd.Filter = "Gescannte Dokumente (*.jpg)|*.jpg"
ofd.Title = "Datei zum Öffnen auswählen"
If ofd.ShowDialog() = DialogResult.OK Then
MsgBox("Datei wurde ausgewählt.")
Else
MsgBox("Abbruch durch User.")
End
End If
' Upload a file.
Dim localFilename As String
localFilename = ofd.FileName
Dim remoteFilename As String
remoteFilename = ofd.SafeFileName
Dim user As String
Dim pwd As String
Dim ziel As String
ziel = "Zielordner"
user = "benutzer"
pwd = "passwort"
success = ftp.PutFile(localFilename, remoteFilename)
'My.Computer.Network.UploadFile(ofd.SafeFileName, ziel, user, pwd, True)
MsgBox("Warten Sie bis Sie sich eine infobox öffnet.", MsgBoxStyle.Critical)
If (success <> True) Then
MsgBox(ftp.LastErrorText)
Return (0)
Exit Function
End If
ftp.Disconnect()
MsgBox("File Uploaded!")
End
Return (0)
End Function
'######################### Ende Funktion Upload ##############################
'######################### Funktion FileExist ################################
Public Function fileExist()
' Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")
If (success <> True) Then
MsgBox(ftp.LastErrorText, MsgBoxStyle.Information, "KANN SEIN3!")
Return (0)
Exit Function
End If
ftp.Hostname = "FTP IP"
ftp.Username = "benutzer"
ftp.Password = "password"
' Connect and login to the FTP server.
success = ftp.Connect()
If (success <> True) Then
MsgBox(ftp.LastErrorText, MsgBoxStyle.Information)
Return (0)
Exit Function
End If
' Set the current remote directory to where the file is located:
success = ftp.ChangeRemoteDir("Zielordner")
If (success <> True) Then
MsgBox(ftp.LastErrorText & vbCrLf & "Das muss die Fehlermeldung sein", MsgBoxStyle.Information)
Return (0)
Exit Function
End If
' Test to see if the file exists by getting the file size by name.
' If a -1 is returned, the file does not exist.
Dim fileSize As Long
fileSize = ftp.GetSizeByName(ofd.SafeFileName)
If (fileSize < 0) Then
Text = Text & "file does not exist" & vbCrLf
Else
Text = Text & "file exists and is " & fileSize & " bytes in size" & vbCrLf
End If
ftp.Disconnect()
Return (0)
End Function
'######################### Ende Funktion FileExist ###########################
Private Function FileExists(ByVal FileName As String) As Boolean
On Error Resume Next
FileExists = Not CBool(GetAttr(FileName) And (vbDirectory Or vbVolume))
On Error GoTo 0
End Function
End Class