Jump to content

help me with FileReadLine function


Recommended Posts

it"s ok , read and if you have the answer , write it

thanks

The code you posted had syntax errors so it has never run as it is..

You should rename md5.dll to something else giving a txt file a dll extension can only lead to trouble and confusion.

Try this.

$File=""
$Count=0
Dim $aMD5HashValues[1]

_FileReadToArray("C:\some pathe\md5.dll",$aMD5HashValues)    ;<<<<<< Change this to correct path
If @error Then 
     MsgBox(16,"Load MD5.dll", "Unable to load md5.dll" & @CR   & "Error: " & @error)
         Exit
EndIf

While $File <> -1
    ; get the file to be checked
    $File = ScanFolder("D:\karim\dallas")
    ToolTip($File,0,200)
        $md5cod = _MD5Init()
                ; calculate md5 hash value
        _MD5Input($md5cod, FileRead ($File))
        $result =   _MD5Result($md5cod)
                ; compare result to each of the values stored in md5.dll
        For $iMD5 = 1 To $aMD5HashValues[0]
            If $result = $aMD5HashValues[$iMD5] Then 
                       MsgBox(16,"find",$File  ,$File)
            EndIf
        Next
    $Count += 1
    If $Count >= 3000 Then
       $File = ScanFolder("-ABORT-")
    EndIf
WEnd

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

The code you posted had syntax errors so it has never run as it is..

You should rename md5.dll to something else giving a txt file a dll extension can only lead to trouble and confusion.

Try this.

$File=""
$Count=0
Dim $aMD5HashValues[1]

_FileReadToArray("C:\some pathe\md5.dll",$aMD5HashValues)    ;<<<<<< Change this to correct path
If @error Then 
     MsgBox(16,"Load MD5.dll", "Unable to load md5.dll" & @CR   & "Error: " & @error)
         Exit
EndIf

While $File <> -1
    ; get the file to be checked
    $File = ScanFolder("D:\karim\dallas")
    ToolTip($File,0,200)
        $md5cod = _MD5Init()
                ; calculate md5 hash value
        _MD5Input($md5cod, FileRead ($File))
        $result =   _MD5Result($md5cod)
                ; compare result to each of the values stored in md5.dll
        For $iMD5 = 1 To $aMD5HashValues[0]
            If $result = $aMD5HashValues[$iMD5] Then 
                       MsgBox(16,"find",$File  ,$File)
            EndIf
        Next
    $Count += 1
    If $Count >= 3000 Then
       $File = ScanFolder("-ABORT-")
    EndIf
WEnd

thanks a lot my frien your way is worked

Link to comment
Share on other sites

the code work , but he serach only for 4 codes of the files

The reason is that there are only 4 codes in the version of md5.dll that you posted.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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...