New function GetNetCardInfo() return a array with information about a particular network adapter on the local computer. the source code is reserved by fivewin...
//positions inside array returned by GetNetCardInfo()
#define ADP_NAME 1//An ANSI character string of the name of the adapter. (STRING) #define ADP_DESCRIPTION 2//An ANSI character string that contains the description //of the adapter. (STRING) #define ADP_ADDRESS 3//The hardware address for the adapter (STRING) #define ADP_INDEX 4//The adapter index. //The adapter index may change when an adapter is disabled //and then enabled, or under other circumstances, //and should not be considered persistent.(NUMERIC) #define ADP_TYPE 5//The adapter type. see define list type (bellow) (NUMERIC) #define ADP_DHCPENABLED 6//An option value that specifies whether the dynamic host //configuration protocol (DHCP) is enabled for this adapter.(LOGICAL)
#define ADP_ADDRESSLIST 7//The list of IPv4 addresses associated with this adapter(STRING) #define ADP_GATEWAY 8//The IPv4 address of the gateway for this adapter (STRING) #define ADP_DHCPSERVER 9//The IPv4 address of the DHCP server for this adapter represented(STRING) #define ADP_HAVEWINS 10//An option value that specifies whether this adapter uses (LOGICAL) //the Windows Internet Name Service (WINS).(LOGICAL) #define ADP_PRIMARY 11//the IPv4 address of the primary WINS server #define ADP_SECUNDARY 12//The IPv4 address of the secondary WINS server
//Types #define MIB_IF_TYPE_OTHER 1//Some other type of network interface. #define MIB_IF_TYPE_ETHERNET 6//An Ethernet network interface. #define MIB_IF_TYPE_TOKENRING 9 #define MIB_IF_TYPE_PPP 23//A PPP network interface. #define MIB_IF_TYPE_LOOPBACK 24//A software loopback network interface. #define MIB_IF_TYPE_SLIP 28//An ATM network interface. #define IF_TYPE_IEEE80211 71//An IEEE 802.11 wireless network interface. //Note This adapter type is returned on Windows Vista and later. //On Windows Server 2003 and Windows XP , //an IEEE 802.11 wireless network interface returns an adapter //type of MIB_IF_TYPE_ETHERNET.
HB_FUNC(GETALLMACADDRESS) { IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information for up to 16 NICs DWORD dwBufLen = sizeof(AdapterInfo); // Save the memory size of buffer unsigned char ret[20] ={0}; PHB_ITEM pArray; PHB_ITEM pItem;
DWORD dwStatus = GetAdaptersInfo(// Call GetAdapterInfo AdapterInfo, // [out] buffer to receive data &dwBufLen); // [in] size of receive data buffer PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info pArray = hb_itemNew(NULL); hb_arrayNew( pArray, 0);
assert(dwStatus == ERROR_SUCCESS); // Verify return value is valid, no buffer overflow
New function GetNetCardInfo() return a array with information about a particular network adapter on the local computer. the source code is reserved by fivewin...
//positions inside array returned by GetNetCardInfo()
#define ADP_NAME 1//An ANSI character string of the name of the adapter. (STRING) #define ADP_DESCRIPTION 2//An ANSI character string that contains the description //of the adapter. (STRING) #define ADP_ADDRESS 3//The hardware address for the adapter (STRING) #define ADP_INDEX 4//The adapter index. //The adapter index may change when an adapter is disabled //and then enabled, or under other circumstances, //and should not be considered persistent.(NUMERIC) #define ADP_TYPE 5//The adapter type. see define list type (bellow) (NUMERIC) #define ADP_DHCPENABLED 6//An option value that specifies whether the dynamic host //configuration protocol (DHCP) is enabled for this adapter.(LOGICAL)
#define ADP_ADDRESSLIST 7//The list of IPv4 addresses associated with this adapter(STRING) #define ADP_GATEWAY 8//The IPv4 address of the gateway for this adapter (STRING) #define ADP_DHCPSERVER 9//The IPv4 address of the DHCP server for this adapter represented(STRING) #define ADP_HAVEWINS 10//An option value that specifies whether this adapter uses (LOGICAL) //the Windows Internet Name Service (WINS).(LOGICAL) #define ADP_PRIMARY 11//the IPv4 address of the primary WINS server #define ADP_SECUNDARY 12//The IPv4 address of the secondary WINS server
//Types #define MIB_IF_TYPE_OTHER 1//Some other type of network interface. #define MIB_IF_TYPE_ETHERNET 6//An Ethernet network interface. #define MIB_IF_TYPE_TOKENRING 9 #define MIB_IF_TYPE_PPP 23//A PPP network interface. #define MIB_IF_TYPE_LOOPBACK 24//A software loopback network interface. #define MIB_IF_TYPE_SLIP 28//An ATM network interface. #define IF_TYPE_IEEE80211 71//An IEEE 802.11 wireless network interface. //Note This adapter type is returned on Windows Vista and later. //On Windows Server 2003 and Windows XP , //an IEEE 802.11 wireless network interface returns an adapter //type of MIB_IF_TYPE_ETHERNET.
function main()
xbrowse( GetNetCardInfo())
returnnil
hola como puedo sacar la ip de internet y de la computadora en donde se ejecute una aplicación
Gracias. Saluditos
Que es mejor que programar? creo que nada
Atropellada pero aqui ando