1 Replies - 296 Views - Last Post: 30 September 2012 - 09:14 AM Rate Topic: -----

#1 the5thelement  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 30-July 12

Updater Just Stands Still

Posted 30 September 2012 - 09:11 AM

I am working on an update application from another project of mine.
I am testing it every time I make changes. However now that I feel
like I am getting somewhere when I launch the application it just
stands still. VB.Net isn't showing errors and I am not quite sure
what is wrong.

Imports System.IO
Public Class Form1
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        DownloadPatchNames_txt()
        Timer1.Start()
    End Sub
    Private Sub DownloadPatchNames_txt()
        Dim PatchNamesRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://dl.dropbox.com/u/89372994/Warcraft%20Battlegrounds/PatchNames.txt")
        Dim PatchNamesResponse As System.Net.HttpWebResponse = PatchNamesRequest.GetResponse()
        Dim PatchNamesStream As System.IO.StreamReader = New System.IO.StreamReader(PatchNamesResponse.GetResponseStream())
        While Not PatchNamesStream.EndOfStream
            Dim PatchName As String = PatchNamesStream.ReadLine()
            ComboBox1.Items.Add(PatchName)
        End While
        DownloadPatchLocations_txt()
    End Sub
    Private Sub DownloadPatchLocations_txt()
        Dim PatchLocationsRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://dl.dropbox.com/u/89372994/Warcraft%20Battlegrounds/PatchLocations.txt")
        Dim PatchLocationsResponse As System.Net.HttpWebResponse = PatchLocationsRequest.GetResponse()
        Dim PatchLocationsStream As System.IO.StreamReader = New System.IO.StreamReader(PatchLocationsResponse.GetResponseStream())
        While Not PatchLocationsStream.EndOfStream
            Dim PatchLocations As String = PatchLocationsStream.ReadLine()
            ComboBox2.Items.Add(PatchLocations)
        End While
        CheckForPatch()
    End Sub
    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        ComboBox2.SelectedIndex = ComboBox1.SelectedIndex
    End Sub
    Private Sub CheckForPatch()
        ComboBox1.SelectedIndex = ComboBox1.SelectedIndex + 1
        If ComboBox2.Text = ("Data/") Then
            If File.Exists(My.Computer.FileSystem.CurrentDirectory & "/Data/" & ComboBox1.Text) Then
                CheckForPatch()
            Else
                Label3.Text = ("Downloading: " & ComboBox1.Text)
                Using mywc As New System.Net.WebClient
                    AddHandler mywc.DownloadProgressChanged, AddressOf pchanged
                    AddHandler mywc.DownloadFileCompleted, AddressOf done
                    mywc.DownloadFileAsync(New Uri("https://dl.dropbox.com/u/89372994/Warcraft%20Battlegrounds/" & ComboBox1.Text), My.Computer.FileSystem.CurrentDirectory & "/Data/" & ComboBox1.Text)
                End Using
            End If
        End If
        If ComboBox2.Text = ("Data/enUS/") Then
            If File.Exists(My.Computer.FileSystem.CurrentDirectory & "/Data/enUS/" & ComboBox1.Text) Then
                CheckForPatch()
            Else
                Label3.Text = ("Downloading: " & ComboBox1.Text)
                Using mywc As New System.Net.WebClient
                    AddHandler mywc.DownloadProgressChanged, AddressOf pchanged
                    AddHandler mywc.DownloadFileCompleted, AddressOf done
                    mywc.DownloadFileAsync(New Uri("https://dl.dropbox.com/u/89372994/Warcraft%20Battlegrounds/" & ComboBox1.Text), My.Computer.FileSystem.CurrentDirectory & "/Data/enUS/" & ComboBox1.Text)
                End Using
            End If
        End If
    End Sub
    Sub pchanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs)
        ProgressBar1.Value = e.ProgressPercentage
    End Sub
    Sub done(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
        ' Notify if download is completed successfully
        If e.Error Is Nothing Then
            ProgressBar1.Value = ProgressBar1.Minimum
            ProgressBar1.Style = ProgressBarStyle.Marquee
            Label3.Text = ("Applying: " & ComboBox1.Text)
            Timer2.Start()
        Else
            MsgBox(e.Error.Message)
        End If
    End Sub

    Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
        ProgressBar2.Value = ProgressBar2.Value + 1
        If ProgressBar2.Value = ProgressBar2.Maximum Then
            ProgressBar1.Style = ProgressBarStyle.Blocks
            ProgressBar2.Value = ProgressBar2.Minimum
            CheckForPatch()
            Timer2.Stop()
        End If
    End Sub
End Class


Is This A Good Question/Topic? 0
  • +

Replies To: Updater Just Stands Still

#2 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Updater Just Stands Still

Posted 30 September 2012 - 09:14 AM

Then you need to place a break point, and go through your code either break point by break point, or by pressing F11 to step through the code one line at a time. We can't debug for you, so you'll have to do that for yourself. If you have any questions that are more specific, and pertain to an issue that you discover and can't figure out then we would be glad to help you out.

Debugging Via Break Point
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1