thanks for reply
And one more thing that ,i want to display MACID first two characters in one
textfield,and next two characters in next textfield .
The maximum length of textfield should be 2 characters,and then focus to next
textfield. Can u help me plz...
thanks,
kiran
On 24-Jun-09, at 12:28 PM, Laurent Cerveau wrote:
You can use IOKit UserLibg get the MAC hardware address. I did not retest it
though (it comes from older code) so you probably have to check for small bugs.
laurent
kern_return_t kernResult;
mach_port_t masterPort;
io_service_t tmpService, controllerService;
CFDataRef macAddressData;
CFMutableDictionaryRef classesToMatch;
//Get the master port
kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
//Find the etherner 0 card criteria
classesToMatch = IOBSDNameMatching(masterPort,0,"en0");
//find the corresponding service
tmpService = IOServiceGetMatchingService(masterPort, classesToMatch);
// by asking for it specifically.
kernResult = IORegistryEntryGetParentEntry( tmpService, kIOServicePlane,
&controllerService );
//now we get the data and do something with them
macAddressData = (CFDataRef) IORegistryEntryCreateCFProperty(
controllerService,CFSTR(kIOMACAddress), kCFAllocatorDefault, 0);
//release what is needed
CFRelease(macAddressData);
IOObjectRelease(controllerService);
IOObjectRelease(tmpService);
On Jun 23, 2009, at 9:04 AM, Kiran Kumar wrote:
Hi all,
i am doing project to change MAC Address ,i want to display MACID in
a single textbox like 00:15:e9:4c:c3:d7
or 00-15-e9-4c-c3-d7 can any one help me plz ...
Thanks,
kiran
The information contained in this email and any attachments is confidential and
may be subject to copyright or other intellectual property protection. If you
are not the intended recipient, you are not authorized to use or disclose this
information, and we request that you notify us by reply mail or telephone and
delete the original message from your mail system.
_______________________________________________
Cocoa-dev mailing list
([email protected]<mailto:[email protected]>)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com
This email sent to [email protected]<mailto:[email protected]>
________________________________
The information contained in this email and any attachments is confidential and
may be subject to copyright or other intellectual property protection. If you
are not the intended recipient, you are not authorized to use or disclose this
information, and we request that you notify us by reply mail or telephone and
delete the original message from your mail system.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]