-
September 23rd, 2009, 10:58 AM
#1
C++ Mac Address
How do i get the mac address of the computer it is run on and return it using a variable (i know strings work better but i need to use chars for my project I'm working on)
-
September 23rd, 2009, 11:04 AM
#2
Re: C++ Mac Address
You can achieve this by simple piece of dos command.
ipconfig /all >> [path]
path should be a txt file location in which you will get all the NIC MAC address. Then you just need to manipulate it a bit more to server your purpose.
-
September 23rd, 2009, 11:05 AM
#3
Re: C++ Mac Address
I'm sort-of a self taught newbie with c++ i don't get what you mean.... i need step by step please if you are willing.
-
September 23rd, 2009, 11:08 AM
#4
Re: C++ Mac Address
See.. 1st place the dos command "ipconfig /all" (without quotes) into dos and see the output. you will find all the mac of ur nics. then you just need to catch this mac address in ur c++ code.. better u start off c++ file handling before doing this..
-
September 23rd, 2009, 11:11 AM
#5
Re: C++ Mac Address
c++ file handling.... is that out.put and in.get? because i use that all the time.
-
September 23rd, 2009, 11:29 AM
#6
Re: C++ Mac Address
what do u mean by out.put. Is this file pointers?. start off with good book. u can use H. Shildt C/C++ Complete reference.
-
September 23rd, 2009, 11:49 AM
#7
Re: C++ Mac Address
Do you need this?
How to get my IP address?
And don't use any sort of command redirection into file, and parsing the file. That is absurd. A command window may open, would distract the user. And most importantly, output of any command (like 'ipconfig') may change by different versions of OS.
-
September 23rd, 2009, 12:06 PM
#8
Re: C++ Mac Address
ya that is always better if you can code for network programming
-
September 23rd, 2009, 01:03 PM
#9
Re: C++ Mac Address
Originally Posted by Ajay Vijay
Do you need this?
How to get my IP address?
And don't use any sort of command redirection into file, and parsing the file. That is absurd. A command window may open, would distract the user. And most importantly, output of any command (like 'ipconfig') may change by different versions of OS.
MAC address, not IP address.
OP: See the IP Helper API:
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|