|
You last visited: Today at 19:59
Advertisement
Updater Problem.
Discussion on Updater Problem. within the .NET Languages forum part of the Coders Den category.
07/20/2013, 01:18
|
#1
|
elite*gold: 0
Join Date: Oct 2010
Posts: 43
Received Thanks: 2
|
Updater Problem.
Hey
ich habe einen updater geschrieben
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
danke im vorraus wenn ihr mir helfen würdet
LG vbcji
|
|
|
07/20/2013, 01:51
|
#2
|
elite*gold: 0
Join Date: May 2009
Posts: 438
Received Thanks: 338
|
Wie viele Threads möchtest du noch erstellen?
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.
.....
|
|
|
07/20/2013, 13:09
|
#3
|
elite*gold: 0
Join Date: Oct 2010
Posts: 43
Received Thanks: 2
|
Quote:
Originally Posted by f1Nn
Wie viele Threads möchtest du noch erstellen?
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 habe halt nur das problem noch
kannst du mich helfen ?
lg vbcji
|
|
|
07/20/2013, 13:37
|
#4
|
elite*gold: 0
Join Date: Feb 2013
Posts: 1,137
Received Thanks: 869
|
Du solltest nochmal einen Thread erstellen, so läuft das hier
|
|
|
07/20/2013, 13:42
|
#5
|
elite*gold: 1
Join Date: May 2013
Posts: 934
Received Thanks: 191
|
Quote:
Originally Posted by Schlüsselbein
Du solltest nochmal einen Thread erstellen, so läuft das hier
|
Ich glaub er hats jetzt geblickt, wie wärs wenn ihr ihm einfach helft, statt immer nur dumme kommentare abzugeben?
|
|
|
07/20/2013, 15:03
|
#6
|
elite*gold: 0
Join Date: Apr 2013
Posts: 49
Received Thanks: 0
|
Ich Würde das ganze Mal in einen Backgrundwoker packen
|
|
|
07/20/2013, 15:06
|
#7
|
elite*gold: 0
Join Date: Oct 2010
Posts: 43
Received Thanks: 2
|
Quote:
Originally Posted by TannelTV
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
|
|
|
07/20/2013, 16:45
|
#8
|
elite*gold: 0
Join Date: Jul 2013
Posts: 13
Received Thanks: 3
|
Lies dir doch bitte die Hinweise von Visual Studio einmal durch. Schenke dabei dem Wort "rekursiv" besondere Beachtung.
Rekursion
Die drei unten deklarierten Eigenschaften rufen sich selbst wieder auf. Dadurch entsteht eine Dauerschleife aus dem die Anwendung nicht raus kommt.
Falls du auf die drei Werte nicht öffentlich zugreifen willst, definier statt den drei Eigenschaften drei neue Variablen.
Code:
Dim bytes as Double
Dim downloadsekunden as Integer
Dim...
Und nutze diese statt den Eigenschaften.
PS: Mit VB.Net wirst du mehr leiden, als du denkst, spring so früh wie möglich auf C# um. Ein kleiner Rat.
|
|
|
07/20/2013, 17:39
|
#9
|
elite*gold: 0
Join Date: Oct 2010
Posts: 43
Received Thanks: 2
|
also soll ich anstat der
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
soll ich dann irgend wo
dim bytes as double .... ?
|
|
|
07/20/2013, 17:59
|
#10
|
elite*gold: 0
Join Date: Jul 2013
Posts: 13
Received Thanks: 3
|
Ja, so wie du es auch mit den anderen Variablen gemacht hast:
Quote:
Private WithEvents httpclient As WebClient
Dim Pfad As String = Nothing
Dim sw As New Stopwatch
Dim received As Integer
|
|
|
|
07/20/2013, 18:39
|
#11
|
elite*gold: 0
Join Date: Oct 2010
Posts: 43
Received Thanks: 2
|
Quote:
Originally Posted by patlux
Ja, so wie du es auch mit den anderen Variablen gemacht hast:
|
ich habe keine fehler mehr...
aber wenn ich das versuche dann geht die progressbar nicht und der label der mir anzeigt MB von MB
aber es lädt runter...
habe ich irgend was falsch gemacht xD ?
lg vbcji
|
|
|
|
Similar Threads
|
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 ?
|
Problem Updater / Problema Updater
01/22/2013 - Shaiya Private Server - 0 Replies
/resolved /resuelto
|
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...
|
All times are GMT +2. The time now is 19:59.
|
|