Equivalent to Windows API 'GetUserName()'
Equivalent to Windows API 'GetUserName()'
- Subject: Equivalent to Windows API 'GetUserName()'
- From: Andy Satori <email@hidden>
- Date: Thu, 5 Jun 2003 21:46:37 -0400
I'm certain this is dead easy and I'm just overlooking it, but I want
to find out the current user's name from Objective C. I don't see any
foundation objects that look like they fit the bill.
In Windows, I would simply call the GetUserName() API call:
char *szUser;
DWORD cbUser = MAX_PATH;
szUser = new char[cbUser];
GetUserName(szUser, &cbUser);
printf("Current User Name: %s\n", szUser);
delete szUser;
Unfortunately I don't see an equivalent. I'm assuming I need something
from the Core Foundation to do this, but I'm not entirely certain where
to even look. Any suggestions?
Andy Satori - Druware Software Designs - email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.