Article View: borland.public.cppbuilder.nativeapi
Article #9320Re: Follow-up - Get MAC address + Netbios
From: Mike Collins
Date: Thu, 15 Jul 2004 14:26
Date: Thu, 15 Jul 2004 14:26
38 lines
2212 bytes
2212 bytes
Thanks Mark, I tried you code the last time you posted and it works
purfectly, exactly what I want, except that I'm trying to achive the same
thing using Netbios. I'm writing a system tools 'class' and I don't want to
be statically tired in to anything...
Cheers
"Mark Jacobs" <markj atty critical dotty co dotty uk> wrote in message
news:40f67f41$1@newsgroups.borland.com...
> 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:
<40f691b8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40f67d04@newsgroups.borland.com> <40f67f41$1@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: "Mike Collins" <mikec@kr8.co.uk> From: "Mike Collins" <mikec@kr8.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <40f67d04@newsgroups.borland.com> <40f67f41$1@newsgroups.borland.com> Subject: Re: Follow-up - Get MAC address + Netbios Date: Thu, 15 Jul 2004 15:26:20 +0100 Lines: 40 Organization: kr8 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 82.39.123.106 Message-ID: <40f691b8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089900984 82.39.123.106 (15 Jul 2004 07:16:24 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail