hi
ich habe bei diesem codestück:
for $i = 0 to $count
FileWrite($woerter,"User: " & $userarray[$i] &" Passwort: " & $passarray[$i] & @CRLF)
Next
diesen fehler:
J:\logs auswerten.au3 (55) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
FileWrite($woerter,"User: " & $userarray[$i] &" Passwort: " & $passarray[$i] & @CRLF)
FileWrite($woerter,"User: " & ^ ERROR
raff ich net
komplett:
Spoiler anzeigen
#include <Array.au3>
#include <File.au3>
$logs = @ScriptDir&"logs\"
$user = "Ungefiltert: Key= USER Parameter= *.*"
$pass = "Ungefiltert: Key= PASS Parameter= *.*"
$woerter = FileOpen("passwoerter.txt",1)
$search = FileFindFirstFile($logs&"*TXT")
if @error = 1 Then
MsgBox(0,"Fehler","Ordner ist leer.")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
if @error = 1 Then
MsgBox(0,"Fertig","Keine Logdateien mehr.")
Exit
EndIf
$fileop = FileOpen($logs&$file,0)
$logtext = FileRead($fileop)
$userarray = StringRegExp($logtext, $user,3)
if @error = 1 then MsgBox(0,"Fehler", "Nichts gefunden")
if @error = 2 then MsgBox(0,"Fehler", "Pattern funzt net")
$passarray = StringRegExp($logtext, $pass,3)
if @error = 2 then
MsgBox(0,"Fehler", "Pattern funzt net")
Else
if @error = 1 then
MsgBox(0,"Fehler", "Nichts gefunden")
Else
FileClose($fileop)
;~ _ArrayDisplay($userarray)
;~ _ArrayDisplay($passarray)
$count = UBound($userarray)
$count1 = UBound($passarray)
MsgBox(0,"",$count)
if $count = $count1 Then
$count = $count -1
for $i = 0 to $count
FileWrite($woerter,"User: " & $userarray[$i] &"Passwort: " & $passarray[$i])
Next
EndIf
EndIf
EndIf
;~ MsgBox(0,"Geschafft","Ersten Durchlauf bestanden")
WEnd
ok funktioniert jetzt!!!
mfg bjoerni