🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9302

Re: Problems getting MAC address...

#9302
From: Mark Jacobs
Date: Wed, 14 Jul 2004 13:03
27 lines
1828 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: <40f52efc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40f28d13@newsgroups.borland.com> <40f3bacd$5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3aa0ca650455337a
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: <40f28d13@newsgroups.borland.com> <40f3bacd$5@newsgroups.borland.com>
Subject: Re: Problems getting MAC address...
Date: Wed, 14 Jul 2004 14:03:07 +0100
Lines: 29
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: <40f52efc@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089810172 81.144.157.8 (14 Jul 2004 06:02:52 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail