New topic: Need to get the current Username? try this
<http://forums.realsoftware.com/viewtopic.php?t=46898> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message DaveS Post subject: Need to get the current Username? try thisPosted: Sun Feb 10, 2013 5:18 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4525 Location: San Diego, CA FUNCTION Get_Username() As String #If TargetMacOS #If TargetCarbon Declare Function CSCopyUserName Lib "Carbon" (useShortName As Boolean) As CFStringRef Return CSCopyUserName(False) #EndIf #If TargetCocoa Declare Function NSFullUserName Lib "Cocoa" As CFStringRef Return NSFullUserName #EndIf #ElseIf TargetWin32 Dim custregitem As RegistryItem Try custRegItem = New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion") Return custregitem.value("RegisteredOwner").StringValue Catch Return "?" End Try #Else Return "?" #EndIf END FUNCTION _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
