PDA

View Full Version : Get Network Connection Related to MAC



TobiaszJason
04-20-2010, 10:17 AM
Is there a way to retrieve the network connection related to the MAC address from withing FlexNET Publisher?

RobertDickau
04-20-2010, 06:06 PM
If I follow the question, lc_hostid doesn't gather any other connection information related to the hardware MAC address used for node-locked licenses.

xprt4y
04-28-2010, 10:33 AM
You don't mention if what os/language/technology you're using, so I'll offer up a Windows-only, managed C++ WMI based solution that walks the MAC address and caption names.

For valid values for the "Current" array, refer to
http://msdn.microsoft.com/en-us/library/aa394217%28v=VS.85%29.aspx



#include "windows.h"


using namespace System;
using namespace System::Windows::Forms;
using namespace Microsoft::Win32;


int main(void) {
System::Management::ManagementObjectSearcher^ myMgtObj = gcnew Management::ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter WHERE AdapterType = 'Ethernet 802.3'");
System::Management::ManagementObjectCollection::ManagementObjectEnumerator^ myMgtObjEnum = myMgtObj->Get()->GetEnumerator();

while(myMgtObjEnum->MoveNext()) {
MessageBox::Show(myMgtObjEnum->Current["MACAddress"]->ToString() + " / " + myMgtObjEnum->Current["Caption"]->ToString() );
}
myMgtObjEnum->Reset();
return 0;
}