名称,IP地址,子网掩码,MAC地址
要加载库文件: Iphlpapi.lib
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <Iphlpapi.h>
#include <ntddndis.h>
#include <string>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
int GetAdapters(void)
int main()
{
GetAdapters()
getch()
}
int GetAdapters(void)
{
PIP_ADAPTER_INFO pAdapterInfo
PIP_ADAPTER_INFO pAdapter = NULL
DWORD dwRetVal = 0
UINT i
char szbuffer[500]
char szmacbuffer[10]
char buffer[32]
ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO)
pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC(sizeof (IP_ADAPTER_INFO))
if (pAdapterInfo == NULL)
{
return 1
}
if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW)
{
FREE(pAdapterInfo)
pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC(ulOutBufLen)
if (pAdapterInfo == NULL)
{
return 1
}
}
if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == NO_ERROR)
{
pAdapter = pAdapterInfo
while (pAdapter != NULL)
{
//printf("\tComboIndex: \t5d\n", pAdapter->ComboIndex)
//printf("\tAdapter Name: \t%s\n", pAdapter->AdapterName)
printf("Adapter Name: %s\n", pAdapter->Description)
printf("Type: ")
switch (pAdapter->Type)
{
case MIB_IF_TYPE_OTHER:
PIC芯片加密在配置位中设置的,这个要根据芯片资料去设置的,如果是pickit 3 programmer,在右上角configuratation中根据芯片资料进行配置加密,加密后的芯片无法再使用工具读取程序。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)