Dim client As New Ftp
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 1
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 2 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 2 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 2
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 3 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 3 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 3
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 4 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 4 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 4
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 5 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 5 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 5
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 6 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 6 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 6
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 7 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 7 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 7
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 8 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 8 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 8
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 9 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 9 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 9
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 10 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 10 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 10
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try
Try
'maak verbinding
client.Connect("adres")
client.Login("username", "hierhetwachtwoord")
client.ChangeDirectory("directory")
'verkrijg lijst met items
Dim list As FtpList = client.GetList()
Dim item As FtpItem
'declareer aant (dat is om te bepalen of het de laatste is)
Dim aant As Integer = 1
'gaat lijst af
For Each item In list
'als het de juiste update is, geef dan een prompt
If item.ToString = "Cviewer_" & My.Application.Info.Version.Major + 11 & ".exe" Then
'prompt
Dim a = MsgBox("Er is een nieuwe update beschikbaar. Wilt u deze downloaden?", 64 + 4096 + 4, "Nieuwe Update beschikbaar")
If a = vbYes Then
'download naar bureaublad
client.GetFile("Cviewer_" & My.Application.Info.Version.Major + 11 & ".exe", My.Computer.FileSystem.SpecialDirectories.Desktop & "\Cviewer_" & My.Application.Info.Version.Major + 1 & ".exe")
MsgBox("De update is gedownload naar het bureaublad, vergeet niet de oude versie te verwijderen.", 64 + 4096, "Update gedownload")
End If
Exit For
Else
'als het de laatste is -> prompt
If aant = list.Count Then
Else
aant += 11
End If
End If
Next item
Catch ex As Exception
client.Disconnect()
MsgBox("Er is een fout opgetreden: " & ex.Message, 16 + 4096, "Error")
Finally
client.Disconnect()
End Try