Nunos Posted November 3, 2021 Posted November 3, 2021 I downloaded a UDF from https://www.autoitscript.com/forum/topic/151920-network-interface-info-statistics-and-traffic/ by Ascend4nt. I am trying to write specific values from the array but I am not sure what I am doing wrong. #include "_NetworkStatistics.au3" #include <array.au3> #include <File.au3> #include <FileConstants.au3> Local $sFilePath = @ScriptDir & "\IPInfo.log" If Not _FileCreate($sFilePath) Then MsgBox($MB_SYSTEMMODAL, "Error", " Error Creating/Resetting log. error:" & @error) EndIf ; Open the file for reading and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, $FO_READ + $FO_OVERWRITE) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") ; Return EndIf Local $net = _Network_IPAllAddressTable(1, 0, 0) If Not @error Then FileWrite($hFileOpen, "IPv4Address: " & $net[11] & @CRLF) EndIf In the UDF he shows [$i][11] , [$i][13] , [$i][15] , [$i][17] as having the information I would like to get to the log file. What am I doing wrong in my code?
Gianni Posted November 3, 2021 Posted November 3, 2021 _Network_IPAllAddressTable returns a 2D array so you have to use $net[0][11] Nunos 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Nunos Posted November 3, 2021 Author Posted November 3, 2021 (edited) Ohhhh Thank you that helps... Edited November 3, 2021 by Nunos
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now