Jump to content

Ini/Array Help


Particle
 Share

Recommended Posts

Ok heres the basics. Im designing a program to allow users to load multiple files and folders into an Ini database and lock them from use with a single password for all or multiple passwords read from another Ini database. The problem I have is for the source code for folders. It seems to only lock the most recently folder loaded into the database and Im thinking something is coded wrong with the Arrays. Please help!!

Heres the code in the while 1 loop:

If $file <> "" Then
        Dim $Array
        _FileReadToArray(@WorkingDir&"\fdb.ini", $Array )
        For $z = 1 to $Array[0]
            $tmp = StringSplit($Array[$z],"=")
            If @Error = 1 Then
                _ReduceMemory()
            Else
                $filey = $tmp[2]
                If $filey <> "" and @error <> 1 Then
                    $temp = StringSplit($file,"\")
                    For $i = 1 to $temp[0]
                        $tmpreturn = $temp[$i]
                    Next
                EndIf
                If WinExists($tmpreturn) = 1 and $input <> 0 Then
                    WinKill($tmpreturn,"")
                    _PLock()
                EndIf
            EndIf
        Next
    EndIf

And heres the Functions used:

Func _PLock()
    $input = InputBox("","Password:","","*")
    If $input = $pw Then
        MsgBox(0,"Error","Access Granted",4)
        $input = 0
        _GUICtrlListDeleteItem($data,0)
        IniDelete(@WorkingDir&"\pdb.ini","data",$tmp[1])
        ShellExecute($File)
    Else
        MsgBox(0,"Error","Access Denied",4)
        $input = 1
    EndIf
EndFunc

Func _ReduceMemory()
   DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1)
EndFunc
Edited by Particle
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...