| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Stephan
On Nov 7, 2006, at 7:03 PM, Eric Blanpied wrote:
Is there some standard way to get the current short user name?
I'm using this code, which I cribbed from a developer.apple.com page on supporting fast user switching. It works fine on my development machine, but on a machine that's only got one account, it turns out it's not the right answer. Makes sense, I guess.
CFStringRef shortUserName; CFDictionaryRef sessionInfoDict;
sessionInfoDict = CGSessionCopyCurrentDictionary(); if (sessionInfoDict == NULL) NSLog(@"Unable to get session dictionary.");
shortUserName = CFDictionaryGetValue(sessionInfoDict, kCGSessionUserNameKey);
_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
| References: | |
| >Getting current user short name (From: Eric Blanpied <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.