Article View: borland.public.cppbuilder.nativeapi
Article #9317Re: Follow-up - Get MAC address + Netbios
From: Mark Jacobs
Date: Thu, 15 Jul 2004 12:57
Date: Thu, 15 Jul 2004 12:57
26 lines
1757 bytes
1757 bytes
AnsiString mjgetnicinfo()
{
IP_ADAPTER_INFO AdapterInfo[16];
AnsiString retv=""; unsigned int ii;
DWORD dwBufLen,dwStatus;
dwBufLen=sizeof(AdapterInfo);
dwStatus=GetAdaptersInfo(AdapterInfo,&dwBufLen);
if (dwStatus!=ERROR_SUCCESS) return "**Could not Obtain NIC Info";
PIP_ADAPTER_INFO pAdapterInfo=AdapterInfo;
do
{
retv+="Name :"+AnsiString(pAdapterInfo->AdapterName)+
"\r\nDescription :"+AnsiString(pAdapterInfo->Description)+"\r\nMAC:";
for (ii=0;ii<pAdapterInfo->AddressLength;++ii)
retv+=IntToHex(pAdapterInfo->Address[ii],2)+" ";
retv+="\r\n"; pAdapterInfo=pAdapterInfo->Next;
}
while (pAdapterInfo);
return retv;
}
--
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
markj atty critical dotty co dotty uk
Technical Details
Message-ID:
<40f67f41$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40f67d04@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a91e1e6bea0334ae X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Mark Jacobs" <markj atty critical dotty co dotty uk> From: "Mark Jacobs" <markj atty critical dotty co dotty uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <40f67d04@newsgroups.borland.com> Subject: Re: Follow-up - Get MAC address + Netbios Date: Thu, 15 Jul 2004 13:57:37 +0100 Lines: 28 Organization: DK Computing X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 81.144.157.8 Message-ID: <40f67f41$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089896257 81.144.157.8 (15 Jul 2004 05:57:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail