Jump to content

Write From Array Certain Information


Recommended Posts

I downloaded a UDF from https://www.autoitscript.com/forum/topic/151920-network-interface-info-statistics-and-traffic/ by Ascend4ntI 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)
; 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

Local $net = _Network_IPAllAddressTable(1, 0, 0)

If Not @error Then
    FileWrite($hFileOpen, "IPv4Address: " & $net[11] & @CRLF)

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?

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

  • Recently Browsing   0 members

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