Cleaner Errors

Posts 1–9 of 9 · Page 1 of 1
Cleaner Errors
Code:
Public Class Form1



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label.Text = "Cleaned."
        If CheckBox1.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.txt")
        End If
        If CheckBox2.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.jpg")
        End If
        If CheckBox3.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.v3d")
        End If
        If CheckBox4.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.bin")
        End If
        If CheckBox5.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.dmp")
        End If
        If CheckBox6.Checked = True Then
            On Error Resume Next
            Kill("C:\Nexon\Combat Arms\*.dump")
        End If
        If CheckBox7.Checked = True Then
            On Error Resume Next
            System.IO.File.SetAttributes("C:\Nexon\Combat Arms\EndingBanner.exe", System.IO.FileAttributes.Normal)
            Kill("C:\Nexon\Combat Arms\EndingBanner.exe")
        End If
        If CheckBox8.Checked = True Then
            On Error Resume Next
            System.IO.File.SetAttributes("C:\Nexon\Combat Arms\CAV.exe", System.IO.FileAttributes.Normal)
            Kill("C:\Nexon\Combat Arms\CAV.exe")
        End If
        If CheckBox9.Checked = True Then
            On Error Resume Next
            If Dir("C:\Nexon\Combat Arms\MOVIES") <> "" Then
                Rename("C:\Nexon\Combat Arms\Game\MOVIES", "C:\Nexon\Combat Arms\Game\CLEANED")
            End If
        End If
    End Sub

    Private Sub CheckBox10_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox10.CheckedChanged
        If CheckBox10.Checked = True Then
            CheckBox1.Checked = True
            CheckBox2.Checked = True
            CheckBox3.Checked = True
            CheckBox4.Checked = True
            CheckBox5.Checked = True
            CheckBox6.Checked = True
            CheckBox7.Checked = True
            CheckBox8.Checked = True
            CheckBox9.Checked = True
        Else
            CheckBox10.Checked = False
            CheckBox1.Checked = False
            CheckBox2.Checked = False
            CheckBox3.Checked = False
            CheckBox4.Checked = False
            CheckBox5.Checked = False
            CheckBox6.Checked = False
            CheckBox7.Checked = False
            CheckBox8.Checked = False
            CheckBox9.Checked = False
        End If
    End Sub
End Class
Errors:
Code:
Error	1	Statement is not valid in a namespace.
Code:
Statement is not valid in a namespace.
Were is takes me to
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
This is what you get for copying and pasting.

See this?:

[php]
Public Class Form1

End Class[/php]

That is where you put all your code, they MUST go inside a class.
ok put if i dont have it like that i get 50 errors and i edited like that
Quote Originally Posted by hhhjr1 View Post
ok put if i dont have it like that i get 50 errors and i edited like that
repost your code. /headdesk
ok i only got this error i fix the rest all ready

Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\Heriberto\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 5 99 WindowsApplication1
Error 2 Reference to a non-shared member requires an object reference. C:\Users\Heriberto\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 6 9 WindowsApplication1
Quote Originally Posted by hhhjr1 View Post
ok i only got this error i fix the rest all ready

Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\Heriberto\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 5 99 WindowsApplication1
Error 2 Reference to a non-shared member requires an object reference. C:\Users\Heriberto\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 6 9 WindowsApplication1
Post your code ffs and the line it's pointing to.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label.Text = "Cleaned."
the label and button part and i edit the code from first post look at it
Do you have a button on your form called Button1?
yes it fixed one
i fixed the other thanks
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?