sara Posted February 14, 2008 Report Share Posted February 14, 2008 Hi everyone... In my project the first front panel is to choose the account if it is administrator or client; If it's an administrator it will lead to a fnother front panel (with control and supervisory), If it's a client it will lead to the same front panel but with less permission (with supevisory only)... So how can I do this ?? Quote Link to comment
Dirk J. Posted February 14, 2008 Report Share Posted February 14, 2008 The user accounts on a system can be read from the registry (stored here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList) The easiest way is to extract them from the ProfileImagePath string value in each 'profile' key. The current (logged on) user can be retreived using the Advapi32.dll exported function GetUserNameA, or use the Application\Username property node. I'm not sure how to get the permissions QUOTE(sara @ Feb 13 2008, 10:21 AM) Hi everyone...In my project the first front panel is to choose the account if it is administrator or client; If it's an administrator it will lead to a fnother front panel (with control and supervisory), If it's a client it will lead to the same front panel but with less permission (with supevisory only)... So how can I do this ?? Quote Link to comment
sara Posted February 14, 2008 Author Report Share Posted February 14, 2008 QUOTE(Dirk J. @ Feb 13 2008, 09:55 AM) The user accounts on a system can be read from the registry (stored here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList)The easiest way is to extract them from the ProfileImagePath string value in each 'profile' key. The current (logged on) user can be retreived using the Advapi32.dll exported function GetUserNameA, or use the Application\Username property node. I'm not sure how to get the permissions Thanks for your replying.. But really I don't understand what are you want to say, So can you please give me an example for it Thanks Quote Link to comment
crelf Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(Dirk J. @ Feb 13 2008, 04:55 AM) The user accounts on a system can be read from the registry (stored here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList) The easiest way is to extract them from the ProfileImagePath string value in each 'profile' key. I agree with Dirk J. - you shoudn't code this unless you need to. Use the logged on user from Windows securtiy (use the LabVIEW "Read Registry Key" VI, or look at LabVIEW DSC - it has user managmenet built in. Also, if you're using TestStand, that has it biult in too. Quote Link to comment
bmoyer Posted February 14, 2008 Report Share Posted February 14, 2008 I was able to dig up some code that was able to get whether the current user is admin or not (it calls an admin.dll) and the login name of the current user. I believe I got the dll from NI's website a while back. Quote Link to comment
crelf Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(bmoyer @ Feb 13 2008, 11:47 AM) I was able to dig up some code that was able to get whether the current user is admin or not (it calls an admin.dll) and the login name of the current user. You could just do this for the user name: http://lavag.org/old_files/monthly_02_2008/post-181-1202924060.gif' target="_blank"> Quote Link to comment
Mellroth Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(crelf @ Feb 13 2008, 06:34 PM) You could just do this for the user name: Or this /J Quote Link to comment
crelf Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(JFM @ Feb 13 2008, 01:05 PM) Or this ...but only if you have the option checked in LabVIEW for it to use the OS logon for app.user (which is on by default, so it's pretty safe). Quote Link to comment
Mellroth Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(crelf @ Feb 13 2008, 07:35 PM) ...but only if you have the option checked in LabVIEW for it to use the OS logon for app.user (which is on by default, so it's pretty safe). True, but App.User is platform independant and could be used on Macs/Linux machines as well. Perhaps it will also work on Vista /J Quote Link to comment
crelf Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(JFM @ Feb 13 2008, 01:49 PM) True, but App.User is platform independant and could be used on Macs/Linux machines as well. Good point - and you can explicitly set where LabVIEW gets the App.User by setting the http://wiki.lavag.org/LabVIEW_configuration_file/History#history.whereToGetName' target="_blank">history.whereToGetName key to "system", or by deleting it (LabVIEW uses "system" by default if the key is missing). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.