How do i get the mac address of the computer it is run on and return it using avariable (i know strings work better but i need to use chars for my project I'm working on)Code:char macchar[50]
Printable View
How do i get the mac address of the computer it is run on and return it using avariable (i know strings work better but i need to use chars for my project I'm working on)Code:char macchar[50]
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.
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.
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..
c++ file handling.... is that out.put and in.get? because i use that all the time.
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.
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.
ya that is always better if you can code for network programming
MAC address, not IP address.
OP: See the IP Helper API:
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx