#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    [NOOB] Unhandled Exception errors


    Hello!

    I am trying to make an application using VB. I do not have much experience but I am trying my best. I cannot figure out why I have these errors. I get errors when I try to open my application, and I get errors when I try to close my application. Take a look at my code and please tell me if you notice anything, or if I should post some more information. THANKS.



    Code:
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim folderBrowser As New FolderBrowserDialog
            If folderBrowser.ShowDialog = DialogResult.OK Then
                TextBox1.Text = folderBrowser.SelectedPath
            End If
        End Sub
    
        Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
            Form2.Show()
        End Sub
    
        Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
    
    
            If Dir(TextBox1.Text & "\Data\enEU\realmlist.wtf") <> "" Then
                Process.Start(TextBox1.Text & "\Data\enEU\realmlist.wtf")
            ElseIf (TextBox1.Text = String.Empty) Then
                MsgBox("Please choose your WoW folder first.")
            Else
                MsgBox("Open with Notepad, delete everything in the file, and type: set realmlist logon.vastwow.com")
                Process.Start(TextBox1.Text & "\Data\enUS\realmlist.wtf")
            End If
        End Sub
    
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            Process.Start("http://www.google.com")
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            If (TextBox1.Text = String.Empty) Then
                MsgBox("Please choose your WoW folder first.")
            Else
                Process.Start(TextBox1.Text & "\VastWoW.exe")
            End If
        End Sub
    
        Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            If Not My.Settings.mysave = TextBox1.Text Then
                My.Settings.mysave = TextBox1.Text
                My.Settings.Save()
                e.Cancel = False
            Else
                e.Cancel = True
            End If
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            If My.Settings.FirstRun = True Then
                MsgBox("Please read the instructions before using this program!")
            End If
    
            My.Settings.FirstRun = False
            My.Settings.Save()
            My.Settings.Reload()
    
            TextBox1.Text = My.Settings.mysave
    
            My.Computer.Audio.Play(My.Resources.backgroundmusic, AudioPlayMode.BackgroundLoop)
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    
        End Sub
    
    End Class
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0
    Nevermind, I fixed it.

    The code I was using was to delete a single file, and not a whole folder.

IMN logo majestic logo threadwatch logo seochat tools logo