Jump to content

Users Accounts


Recommended Posts

Posted

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 ??

Posted

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 ??

Posted

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

Posted

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.

Posted

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.

Posted

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).

Posted

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 :P

/J

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.