<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Code für Mac ADresse]]></title><description><![CDATA[<p>hi,</p>
<p>ich hab den Code für die Mac Adresse gefunden, aber er funktioniert nicht. Das Program gibt mir immer random Zahlen zurück, anstatt der richtigen MAC Adresse.<br />
Hier ist der Code, vielleicht fällt euch ja ein Fehler auf:</p>
<p>#include &lt;windows.h&gt;<br />
#include &lt;iostream&gt;<br />
#include &lt;conio.h&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
cout &lt;&lt; &quot;MAC address is: &quot;;<br />
// Ask COM to create a UUID for us. If this machine has an Ethernet<br />
// adapter, the last six bytes of the UUID (bytes 2-7 inclusive in<br />
// the Data4 element) should be the MAC address of the local<br />
// Ethernet adapter.<br />
GUID uuid;<br />
CoCreateGuid(&amp;uuid);<br />
// Spit the address out<br />
char mac_addr[18];<br />
sprintf(mac_addr,&quot;%02X-%02X-%02X-%02X-%02X-%02X&quot;,<br />
uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],<br />
uuid.Data4[5],uuid.Data4[6],uuid.Data4[7]);<br />
cout &lt;&lt; mac_addr &lt;&lt; endl;<br />
getch();<br />
return 0;<br />
}</p>
<p>Danke schonmal im Vorraus !</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/119517/code-für-mac-adresse</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Jul 2026 19:02:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/119517.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Sep 2005 17:21:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Code für Mac ADresse on Thu, 01 Sep 2005 17:21:38 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ich hab den Code für die Mac Adresse gefunden, aber er funktioniert nicht. Das Program gibt mir immer random Zahlen zurück, anstatt der richtigen MAC Adresse.<br />
Hier ist der Code, vielleicht fällt euch ja ein Fehler auf:</p>
<p>#include &lt;windows.h&gt;<br />
#include &lt;iostream&gt;<br />
#include &lt;conio.h&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
cout &lt;&lt; &quot;MAC address is: &quot;;<br />
// Ask COM to create a UUID for us. If this machine has an Ethernet<br />
// adapter, the last six bytes of the UUID (bytes 2-7 inclusive in<br />
// the Data4 element) should be the MAC address of the local<br />
// Ethernet adapter.<br />
GUID uuid;<br />
CoCreateGuid(&amp;uuid);<br />
// Spit the address out<br />
char mac_addr[18];<br />
sprintf(mac_addr,&quot;%02X-%02X-%02X-%02X-%02X-%02X&quot;,<br />
uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],<br />
uuid.Data4[5],uuid.Data4[6],uuid.Data4[7]);<br />
cout &lt;&lt; mac_addr &lt;&lt; endl;<br />
getch();<br />
return 0;<br />
}</p>
<p>Danke schonmal im Vorraus !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/863028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/863028</guid><dc:creator><![CDATA[bigisoft]]></dc:creator><pubDate>Thu, 01 Sep 2005 17:21:38 GMT</pubDate></item><item><title><![CDATA[Reply to Code für Mac ADresse on Fri, 02 Sep 2005 07:07:22 GMT]]></title><description><![CDATA[<p>Ab Win2000 funktioniert CoCreateGuid nicht wie es bei den vorherigen Versionen tat.<br />
Da solltest Du UuidCreateSequential nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/863347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/863347</guid><dc:creator><![CDATA[Airdamn]]></dc:creator><pubDate>Fri, 02 Sep 2005 07:07:22 GMT</pubDate></item></channel></rss>