ola sou novo no forum
estou criando um launcher
e estou tendo dificuldades, estou com esse erro, gostaria de saber se alguém que saiba de VB possa me dizer como faço para arruma
se quiserem posto a source para dar uma olhada
todo o codigo e esse ainda n ta acabado
Imports System.Security.Cryptography
Imports System.Net
Public Class Form1
WithEvents wb As New WebClient
Dim _arquivos As String
Dim int As Integer = 0
Private Function getFileMd5(ByVal filePath As String) As String
Dim File() As Byte = System.IO.File.ReadAllBytes(filePath)
Dim Md5 As New MD5CryptoServiceProvider()
Dim byteHash() As Byte = Md5.ComputeHash(File)
Return Convert.ToBase64String(byteHash)
End Function
Private Sub form1_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not My.Computer.FileSystem.FileExists(Application.StartupPath & "\filehash.txt") Then
Status.Text = "Baixando lista de atualizações"
wb.DownloadFileAsync(New Uri("******************"), Application.StartupPath & "\filehash.txt")
VerificarArquivos()
Else
VerificarArquivos()
End If
End Sub
Private Sub wb_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles wb.DownloadFileCompleted
int += 1
If _arquivos.Contains("[arquivo1]") Then
Status.Text = "Baixando arquivo1.exe"
wb.DownloadFileAsync(New Uri("******************"), Application.StartupPath & "\arquivo1.exe")
ElseIf _arquivos.Contains("[arquivo2]") Then
Status.Text = "Baixando arquivo1.exe"
wb.DownloadFileAsync(New Uri("********************"), Application.StartupPath & "\arquivo2.exe")
End If
End Sub
Private Sub wb_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles wb.DownloadProgressChanged
ProgressBar1.Maximum = e.TotalBytesToReceive
ProgressBar1.Value = e.BytesReceived
End Sub
Private Sub VerificarArquivos()
Try
Dim _filehash As String() = System.IO.File.ReadAllLines(Application.StartupPath & "\filehash.txt")
If Not My.Computer.FileSystem.FileExists(Application.StartupPath & "\filehash.txt") Then
_arquivos &= "[arquivo1]"
Else
If Not getFileMd5(Application.StartupPath & "\arquivo1.exe") = _filehash(1) Then
_arquivos &= "[arquivo1]"
End If
End If
If Not My.Computer.FileSystem.FileExists(Application.StartupPath & "\filehash.txt") Then
_arquivos &= "[arquivo2]"
Else
If Not getFileMd5(Application.StartupPath & "\arquivo2.exe") = _filehash(4) Then
_arquivos &= "[arquivo2]"
End If
End If
Call wb_DownloadFileCompleted(Nothing, Nothing)
Catch ex As Exception
End Try
End Sub
End Class