DELPHI6中有没有哪个函数能不能获取本机器的网卡类型名?
象控制面板中的网卡显示一样:如:Macronix MX98715 Family Fast Ethernet Adapter(ACPI).

解决方案 »

  1.   

    winexec(pchar('command.com/C ipconfig /all>'+temp),sw_hide);
    //执行命令将查询结果存到到时文件temp,sw_hider指定将dos界面隐藏。
      

  2.   

    好像不行啊。能不能解释一下?
    这个命令受windows系统限制吗?
      

  3.   

    在iphlpapi.dll里面有一个函数:GetAdaptersInfo() 
    好像是干这个用的。说明如下:GetAdaptersInfoThe GetAdaptersInfo function retrieves adapter information for the local computer.DWORD GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, // buffer to receive dataPULONG pOutBufLen // size of data returned);ParameterspAdapterInfo[out] Pointer to a buffer that, , receives a linked list of IP_ADAPTER_INFO structures.pOutBufLen[in] Pointer to a ULONG variable that specifies the size of the buffer pointed to by the pAdapterInfo parameter. If this size is insufficient to hold the adapter information, GetAdaptersInfo fills in this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW.Return ValuesIf the function succeeds, the return value is ERROR_SUCCESS.If the function fails, the return value is one of the following error codes.Value MeaningERROR_BUFFER_OVERFLOW The buffer size indicated by the pOutBufLen parameter is too small to hold the adapter information. The pOutBufLen parameter points to the required size.ERROR_INVALID_PARAMETER The pOutBufLen parameter is NULL, or the calling process does not have read/write access to the memory pointed to by pOutBufLen, or the calling process does not have write access to the memory pointed to by the pAdapterInfo parameter.ERROR_NO_DATA No adapter information exists for the local computer.ERROR_NOT_SUPPORTED GetAdaptersInfo is not supported by the operating system running on the local computer.Other If the function fails, use FormatMessage to obtain the message string for the returned error. RequirementsWindows NT/2000: Requires Windows 2000.Windows 95/98: Requires Windows 98.Header: Declared in Iphlpapi.h.//没有Library: Use Iphlpapi.lib.//没有  IP_ADAPTER_INFOThe IP_ADAPTER_INFO structure contains information about a particular network adapter on the local computer.typedef struct _IP_ADAPTER_INFO {struct _IP_ADAPTER_INFO* Next;DWORD ComboIndex;char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];UINT AddressLength;BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];DWORD Index;UINT Type;UINT DhcpEnabled;PIP_ADDR_STRING CurrentIpAddress;IP_ADDR_STRING IpAddressList;IP_ADDR_STRING GatewayList;IP_ADDR_STRING DhcpServer;BOOL HaveWins;IP_ADDR_STRING PrimaryWinsServer;IP_ADDR_STRING SecondaryWinsServer;time_t LeaseObtained;time_t LeaseExpires;} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;Members
      

  4.   

    NextPointer to the next adapter in the linked list of adapters.ComboIndexThis member is unused.AdapterName[MAX_ADAPTER_NAME_LENGTH + 4]Specifies the name of the adapter.Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4]Specifies a description for the adapter.AddressLengthSpecifies the length of the hardware address for the adapter.Address[MAX_ADAPTER_ADDRESS_LENGTH]Specifies the hardware address for the adapter. //这个是不是你想要的?IndexSpecifies the adapter index.TypeSpecifies the adapter type.DhcpEnabledSpecifies whether dynamic host configuration protocol (DHCP) is enabled for this adapter.CurrentIpAddressSpecifies the current IP address for this adapter.IpAddressListSpecifies the list of IP addresses associated with this adapter.GatewayListSpecifies the IP address of the default gateway for this adapter.DhcpServerSpecifies the IP address of the DHCP server for this adapter.HaveWinsSpecifies whether this adapter uses Windows Internet Name Service (WINS).PrimaryWinsServerSpecifies the IP address of the primary WINS server.SecondaryWinsServerSpecifies the IP address of the secondary WINS server.LeaseObtainedSpecifies the time when the current DHCP lease was obtained.LeaseExpiresSpecifies the time when the current DHCP lease will expire.RequirementsWindows NT/2000: Requires Windows 2000.Windows 95/98: Requires Windows 98.Header: Declared in Iptypes.h. 
      

  5.   

    function GetIpAddTable(pIpAddrTable:pTmibIpaddrTable; pdwSize: pulong;
       bOrder:bool):dword; stdcall; external 'IPHLPAPI.DLL'
      

  6.   

    噢,错了,应该是这个:
      function GetIfTable(pIfTable:PTMibIfTable; pdwsize: pulong; bOrder: boolean):dword;
                     stdcall; external 'IPHLPAPI.DLL';