3 Public Class frmUpdate
\r
5 Private Sub frmUpdate_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
\r
6 If My.Settings.StartupUpdate = 1 Then
\r
7 lbl_startupStatus.Text = "On"
\r
9 lbl_startupStatus.Text = "Off"
\r
12 Version.Text = My.Settings.HandbrakeGUIVersion
\r
13 cliVersion.Text = My.Settings.HandbrakeCLIVersion
\r
16 Private Sub Dest_browse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dest_browse.Click
\r
17 Dim file_path As String = Application.StartupPath
\r
19 ' Download the update file
\r
20 ' open the file for reading and read the first 2 lines for GUI and CLI versions
\r
21 Dim wc As New System.Net.WebClient()
\r
22 wc.DownloadFile("http://download.m0k.org/handbrake/windows/update.txt", file_path & "\update.txt")
\r
24 Dim versionStream As StreamReader = File.OpenText(file_path & "\update.txt")
\r
25 Dim windowsGUI As String = versionStream.ReadLine()
\r
26 Dim windowsCLI As String = versionStream.ReadLine()
\r
27 versionStream.Close()
\r
29 ' Set the Latest Text label to the first line of the file
\r
30 lbl_latest.Text = windowsGUI
\r
31 lbl_encoderVersion.Text = windowsCLI
\r
33 ' If the version is now the same as the one shown here, Display the update label
\r
34 If windowsGUI <> My.Settings.HandbrakeGUIVersion Then
\r
35 lbl_update.Visible = True
\r
36 ElseIf windowsCLI <> My.Settings.HandbrakeCLIVersion Then
\r
37 lbl_update.Visible = True
\r
41 Catch ex As Exception
\r
42 ' Handdle any errors that may occur
\r
43 MessageBox.Show("ERROR: Unable to check for updates. The server may be unavailible at the moment. Please try again later!")
\r
44 MessageBox.Show(ex.ToString) ' Debug output
\r
50 Private Sub btn_close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_close.Click
\r