2014-01-25 27 views
-3

有人可以糾正代碼中的錯誤嗎? 「更新程序」是打開主程序時打開的窗口。我是Visual Basic的新手,所以我向你求助。更新器用於廣告。我正在YT拍攝廣告我的節目。對不起,我的英語和語法,但我來自波蘭。謝謝。有人可以糾正錯誤嗎? - Visual Basic

Public Class updater 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton1.Click 
     PerplexProgressBar1.Value = PerplexProgressBar1.Minimum 
     PerplexButton1.Visible = False 
     PerplexProgressBar1.Visible = True 
     PerplexLabel2.Visible = True 
     PerplexLabel3.Visible = True 

     Timer1.Start() 

     PerplexLabel3.Text = "Connecting to server." 
    End Sub 

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 
     PerplexProgressBar1.Increment(1) 

     If PerplexProgressBar1.Value = 10 Then 
      PerplexLabel3.Text = "Connecting to server.." 

     End If 

     If PerplexProgressBar1.Value = 20 Then 
      PerplexLabel3.Text = "Connecting to server..." 

     End If 


     If PerplexProgressBar1.Value = 50 Then 
      PerplexLabel3.Text = "Connected. Looking for updates..." 
     End If 
     If PerplexProgressBar1.Value = 100 Then 
      Timer1.Stop() 
      PerplexProgressBar1.Visible = False 
      PerplexLabel3.Text = "Important updates are available on server." 
      PerplexLabel1.Text = "Please download the updates to run the program now." 
      PerplexButton2.Visible = True 
     End If 
    End Sub 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton2.Click 
     PerplexButton2.Visible = False 
     PerplexProgressBar1.Visible = True 
     Timer2.Start() 
     PerplexProgressBar1.Value = PerplexProgressBar1.Minimum 
     PerplexLabel1.Text = "Program will download the updates from server." 
     PerplexLabel3.Text = "Downloading updates from server..." 
    End Sub 

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick 
     PerplexProgressBar1.Increment(1) 
     If PerplexProgressBar1.Value = 40 Then 
      PerplexLabel3.Text = "Please wait... Program is updating..." 
     End If 
     If PerplexProgressBar1.Value = 100 Then 
      Timer2.Stop() 
      PerplexProgressBar1.Visible = False 
      PerplexLabel3.Text = "All updates have been downloaded right now." 
      PerplexLabel1.Text = "Program has been successfully updated, run it!" 
      PerplexButton3.Visible = True 
     End If 
    End Sub 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerplexButton3.Click 
     Me.Close() 
     main.Show() 
    End Sub 

    Private Sub updater_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing 
     Me.Opacity = 0 
     main.Enabled = True 
     main.Opacity = 1 
    End Sub 

    Private Sub updater_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
     main.Show() 
     main.Enabled = False 
     main.Opacity = 0.9 
    End Sub 

    Private Function main() As Object 
     Throw New NotImplementedException 
    End Function 

End Class 
+0

似乎是什麼錯誤? –

+0

再次請*說明您遇到的具體問題*,並*提出有關該問題的具體問題*。 「有人能糾正代碼中的錯誤嗎?」不是一個可回答的問題。你知道錯誤是什麼,因爲如果你不知道你有什麼錯誤。你有錯誤信息在你面前,所以沒有理由不把它包含在你的問題中。期待我們試着弄清楚你問的問題簡直是不合理的。 **你**要求**我們**幫助你免費*。你至少可以做的就是給我們提供你已經有的信息,使它更容易。 –

+1

我敢打賭,問題出現在最後五六行代碼中。任何接受者? –

回答

-2

刪除此行的代碼......它應該運行很好...

Private Function main() As Object 
    Throw New NotImplementedException 
End Function