Sign in to follow this  
Followers 0
Ibrahim

GateWay Information

1 post in this topic

Helped me. Hope it helps you

and Any refinements are welcome

#Include<Array.au3>
#include <file.au3>
#include <GuiConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <Process.au3>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;get ip address;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_RunDOS ("ipconfig >c:\ipcon.dat")
ProcessWaitClose("ipconfig.exe")
Dim $iRecords

If Not _FileReadToArray("c:\ipcon.dat",$iRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
$iPos = _ArraySearch ($iRecords, "Gateway", 0, 0, 0, True)
$gatewayIP=$iRecords[$iPos]
$gatewayIP=StringTrimLeft($gatewayIP,44)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Mac Addressssssss;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_RunDOS ("arp -a >c:\arp.dat")
ProcessWaitClose("arp.exe")
Dim $mRecords
If Not _FileReadToArray("c:\arp.dat",$mRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
$Pos = _ArraySearch ($mRecords,$gatewayIP, 0, 0, 0, True)
$gatewaymac=$mRecords[$Pos]
$gatewaymac=StringTrimLeft($gatewaymac,24)
if StringRight($gatewaymac,10)="dynamic   " then $gatewaymac=StringTrimRight($gatewaymac,15)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Ip Address Controlllllllll;;;;;;;;;;;;;;;;;;;;;;
$hgui = GUICreate("Ibrahim Ghorabah Connection detection", 300, 100)
GUICtrlCreateGroup ("GateWay Information (Router)", 10,10,280, 80)
$hIPAddress = _GUICtrlIpAddress_Create ($hgui, 120,30)
GUISetState(@SW_SHOW)
 _GUICtrlIpAddress_Set ($hIPAddress,$gatewayIP)
 GUICtrlCreateInput($gatewaymac,120,60,130,25,$ES_CENTER+$ES_LOWERCASE)
 GUICtrlSetFont (-1,9, 800, 0,"Tahoma")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Share this post


Link to post
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
Sign in to follow this  
Followers 0