What am i doing wrong?

Kenneth

New member
Joined
Jun 19, 2010
Messages
1
Programming Experience
1-3
Hello,
i'm having trouble with the security of my porgram...
it does check if Tio-Hack.exe.config exists, but it doesn't do things that are beneath the if statement there...

here my code:
VB.NET:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button3.Enabled = False
        If (My.Computer.FileSystem.FileExists(Application.StartupPath & "\Tio-Hack.exe.config")) Then
            If My.Settings.FirstTime = True Then
                Dim mc As System.Management.ManagementClass
                Dim mo As ManagementObject
                mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
                Dim moc As ManagementObjectCollection = mc.GetInstances()
                For Each mo In moc
                    If mo.Item("IPEnabled") = True Then
                        My.Settings.MacAdress = mo.Item("MacAddress").ToString()
                        My.Settings.Save()
                        My.Settings.Reload()
                    End If
                Next
                My.Settings.FirstTime = False
                My.Settings.Save()
                My.Settings.Reload()
            ElseIf My.Settings.FirstTime = False Then
                Dim mc As System.Management.ManagementClass
                Dim mo As ManagementObject
                mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
                Dim moc As ManagementObjectCollection = mc.GetInstances()
                For Each mo In moc
                    If mo.Item("IPEnabled") = True Then
                        If My.Settings.MacAdress = mo.Item("MacAddress").ToString() Then
                            Me.Enabled = True
                        Else
                            Me.Enabled = False
                            MsgBox("Buy it yourself!")
                        End If
                    End If
                Next
                    End If
        Else
            Me.Enabled = False
            MsgBox("The File Tio-Hack.exe.config Doesn't exists", 16, "Error")
        End If
    End Sub

my english is not very good, but i hope u can read it:p and understand it:p
i translated some things in my code to english so it's easier to read the code:)
 
Back
Top