Brian Leahy
unread,May 1, 2013, 4:41:58 PM5/1/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
// And you don't even need to declare external functions, run command shells or dig through the registry...
OLEObject objWMIService, IPConfigSet, IPConfig
string s_mac, s_description, s_IP
int rs, i
objWMIService = CREATE OLEObject;
rs = objWMIService.ConnectToObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2");
if (rs = 1) then
IPConfigSet = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
// Will iterate through all active network adapters
for i = 0 to (IPConfigSet.count - 1)
IPConfig = IPConfigSet.ItemIndex(i)
s_mac = (IPConfig.Properties_.Item("MACAddress").Value);
s_description = (IPConfig.Properties_.Item("Description").Value);
s_IP = (IPConfig.Properties_.Item("IPAddress").Value(0));
// Do something with the information here..
next
destroy IPConfig
destroy IPConfigSet
else
MessageBox("ERROR","Could not create OLE object");
end if;
destroy objWMIService