so es hat alles funktioniert bis ich versucht habe
die verbliebene zeit einzufügen also das er sie anzeigt
so
jetzt auf einmal geht progressbar nicht mehr und das mir das anzeigt wieviel mb von mb noch übrig sind
aber download geht
könnt ihr mir helfen ???
Code:
Imports System.Net
Imports System.Timers
Public Class Update
Private WithEvents httpclient As WebClient
Dim Pfad As String = Nothing
Dim sw As New Stopwatch
Dim received As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("Bitte Datei in das Spielverzeichniss unter Update.exe speichern, die .exe ausführen und auf ersetzen klicken !", MsgBoxStyle.Information, "Information")
Me.Hide()
ShowDialog:
SaveFileDialog1.ShowDialog()
If SaveFileDialog1.FileName = Nothing Then
GoTo ShowDialog
End If
Pfad = SaveFileDialog1.FileName
Try
Me.Show()
httpclient = New WebClient
Dim URL As String = "http://www.weebly.com/uploads/2/1/9/9/21997230/updater.exe"
Application.DoEvents()
httpclient.DownloadFileAsync(New Uri(URL), Pfad)
Application.DoEvents()
Catch ex As Exception
MsgBox("ein Fehler ist aufgetreten:" & vbNewLine & ex.ToString, MsgBoxStyle.Critical, "Fehler")
End
End Try
End Sub
Private Sub httpclient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles httpclient.DownloadFileCompleted
MsgBox("Download complete", MsgBoxStyle.Information, "Information")
End
End Sub
Private Sub httpclient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs)
Dim aTimer As New System.Timers.Timer()
AddHandler aTimer.Elapsed, New ElapsedEventHandler(AddressOf OnTimedEvent)
aTimer.Interval = 1000
Dim downloadsekunden As Integer = 0
Me.ProgressBar1.Value = e.ProgressPercentage
Dim Totalbytes As Double = Math.Round(e.TotalBytesToReceive \ 1024 \ 1024, 2)
Dim bytes As Double = Math.Round(e.BytesReceived \ 1024 \ 1024, 2)
Me.Label1.Text = bytes & "MB von " & Totalbytes & "MB"
aTimer.Enabled = True
End Sub
Private Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs)
Downloadsekunden += 1
Dim averagedownload As Integer = bytes / Downloadsekunden
Dim restzeit As Integer = (Totalbytes - bytes) / averagedownload
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Update_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
If (e.Button = Windows.Forms.MouseButtons.Left) Then
Me.Capture = False
Me.WndProc(Message.Create(Me.Handle, &HA1, CType(&H2, IntPtr), IntPtr.Zero))
Else : End If
End Sub
Public Property Bytes() As Double
Get
Return bytes
End Get
Set(ByVal value As Double)
Me.bytes = value
End Set
End Property
Public Property Downloadsekunden() As Integer
Get
Return downloadsekunden
End Get
Set(ByVal value As Integer)
Me.downloadsekunden = value
End Set
End Property
Public Property Totalbytes() As Double
Get
Return Totalbytes
End Get
Set(ByVal value As Double)
Me.Totalbytes = value
End Set
End Property
End Class
ich mache noch ein screen von den warnungen die mir gezeigt werden
Du solltest dir ebenfalls ordentliche Titel überlegen. Wäre der Thread auf Stackoverflow erstellt wurden, wäre er direkt gelöscht. "Updater Problem" sagt gar nichts aus, außer, dass du ein Problem hast was sowieso klar ist. Denk bitte daran in Zukunft und wähle einen gescheiten Titel.
Du solltest dir ebenfalls ordentliche Titel überlegen. Wäre der Thread auf Stackoverflow erstellt wurden, wäre er direkt gelöscht. "Updater Problem" sagt gar nichts aus, außer, dass du ein Problem hast was sowieso klar ist. Denk bitte daran in Zukunft und wähle einen gescheiten Titel.
.....
ja sorrry.
aber eigendlich sind die anderen threds ja so gut wie gelöst...
Ich Würde das ganze Mal in einen Backgrundwoker packen
ne ich will ja das man das sehen kann
und das problem liegt denke ich bei dem timer weil bevor ich das verscuht habe ging alles und jetzt hängt es sich glaube auf aber downloadet ja trostdem
Public Property Bytes() As Double
Get
Return bytes
End Get
Set(ByVal value As Double)
Me.bytes = value
End Set
End Property
Public Property Downloadsekunden() As Integer
Get
Return downloadsekunden
End Get
Set(ByVal value As Integer)
Me.downloadsekunden = value
End Set
End Property
Public Property Totalbytes() As Double
Get
Return Totalbytes
End Get
Set(ByVal value As Double)
Me.Totalbytes = value
End Set
End Property
End Class
Problem with updater !!! 05/15/2013 - Need for Speed World - 3 Replies Hey guys , I have a problem with the updater . When I start the launcher it says : NFSW Launcher Updater has stopped working :| .
Can anyone tell me how can I fix it or do I have to reinstall it ?
Updater Problem 11/25/2012 - Shaiya Private Server - 1 Replies Since a few minutes i got a problem with my updater. Server is running everything is working fine i logged out and for some reason, my updater sais now, "Connection to the server could not be established".
I looked through my DB, and everything looks fine. So can anybody help me to fix my problem?
Kal updater problem .. 08/07/2011 - Kal Online - 3 Replies Hello everybody,,
i've a stupid problem with my computer..
i've downloaded 2 different servers but whenever i start the updater of any of them it tells " Can not download http://sitename.com/updater/file.list "
i'm using Windows7 Home Basic 64 bit - 3GB Ram
Can some1 tell me whats wrong or what shall i do to fix this bullshit :rolleyes:
kal INT updater problem 01/14/2010 - Kal Online - 13 Replies Ahoi.
Wollte nach ner Zeit lang mal wieder INT zocken musste aber feststellen, dass es nen kampf ist Kal überhaupt zum laufen zu bekommen...lol
Ich benutze Windows Vista 64-Bit.
Ich starte den Updater (als Admin)
darauf bekomme ich schon folgende Fehlermeldung:
Exception.exe funktioniert nicht mehr
Ok, updater funzt trotzdem, ABER..sobald dieser fertig ist (was immerhin 5 stunden dauert...) kackt die engine.exe ab und ich darf den updater nochmal neu starten und alles nochmal neu...