Hallo Gemeinde,
Könnte mir jemand auf die Sprünge helfen warum die Msgbox "Ausgabe ArrayIndex" nicht angezeigt wird? Das Array wird erzeugt und kann mit dem Arraydisplay auch angezeigt werden...
Sollte der Befehl arraySearch auf Fehler laufen, so sollte die MsgBox doch trotzdem angezeigt werden oder?
C
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
#include <AutoItConstants.au3>
#include "Array.au3"
; Erstellt von AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
Global $aArray[1]
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Lenovo_BiosSetting", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
ReDim $aArray[UBound($aArray) + 1]
$aArray[UBound($aArray) - 1] = "Active: " & $objItem.Active & " - CurrentSetting: " & $objItem.CurrentSetting
; If MsgBox(1, "WMI-Ausgabe", $Output) = 2 Then ExitLoop
; $Output = ""
Next
;_ArrayDisplay($aArray)
Else
MsgBox(0, "WMI-Ausgabe", "Keine WMI-Objekte gefunden für Klasse: " & "Lenovo_BiosSetting")
EndIf
$sIndex = _ArraySearch($aArray, "PasswordCountExeededError", 0, 0, 0, 1) ; Zahl 1 = Teilsuche
MsgBox(0, "Ausgabe ArrayIndex", $aArray[$sIndex])
Alles anzeigen
Das Array sieht so aus
Row|Col 0
[0]|
[1]|Active: True - CurrentSetting: WakeOnLAN,ACOnly
[2]|Active: True - CurrentSetting: WakeOnLANDock,Enable
[3]|Active: True - CurrentSetting: EthernetLANOptionROM,Enable
[4]|Active: True - CurrentSetting: IPv4NetworkStack,Enable
die gesuchte Zeile ist diese:
[38]|Active: True - CurrentSetting: PasswordCountExceededError,Enable