NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Active Participant
chuck72352
Posts: 295
0 Kudos
Accepted Solution

Access user's login name in Labview

I am a Labview novice. I'm developing an application in which I would like to access the persons name who logged onto the computer. I would then like to match the users name against a list of allowed users in order to run the application. Is there an easy way to accomplish this in Labview?    
Knight of NI
Posts: 18,064

Re: Access user's login name in Labview

[ Edited ]

The Application.UserName will return the user name used to open the application:

 

As for checking it against a list, where's the list coming from? Is it a file? A database? Someplace else? If it's a file you will probably read it into an array and you can then use Search 1D Array to see if the name is in the list (taking into consideration upper/lower case). 

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

Message Edited by smercurio_fc on 02-27-2009 09:39 AM
Active Participant
Awesome_Larry
Posts: 736

Re: Access user's login name in Labview

[ Edited ]
Take a look at the attached code, it is in 8.0.  (Beat to the punch)
 
 
 
 
 
Message Edited by jmcbee on 02-27-2009 08:41 AM
CLA
Select Alliance Partner
Project Engineer
Using LV 2010, 2009, 8.6, 7.1, 6.1


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Active Participant
chuck72352
Posts: 295
0 Kudos

Re: Access user's login name in Labview

I just tried your suggestion in my application and it works great. I dont really understand it but I'll read up.

 

Thank you very much!

Knight of NI
Posts: 18,064

Re: Access user's login name in Labview


jmcbee wrote:
Take a look at the attached code, it is in 8.0.  (Beat to the punch)

Yes, well, you still got marked as the solution, and got a Kudos to boot! I guess sometimes coming in second is better. :smileyvery-happy:

Active Participant
Awesome_Larry
Posts: 736

Re: Access user's login name in Labview

I suppose your answer is the preffered one as you taught him how to fish, whereas I gave him a processed fish sandwich.  Atleast he said he was going to try and figure out how it works, I commend that.  You do deserve atleast a Kudos for replying first with the correct answer.  Id like to add that I don't mind coming in second to you as it is people like you who taught me how to fish, as the metaphore goes.
CLA
Select Alliance Partner
Project Engineer
Using LV 2010, 2009, 8.6, 7.1, 6.1


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Knight of NI
Posts: 18,064

Re: Access user's login name in Labview

I appreciate the comment. My comment was a tongue-in-cheek remark - not getting Kudos is not going to stop me from trying to help. :smileywink:
Active Participant
dan_u
Posts: 1,072
0 Kudos

Re: Access user's login name in Labview

[ Edited ]

smercurio_fc wrote:
I appreciate the comment. My comment was a tongue-in-cheek remark - not getting Kudos is not going to stop me from trying to help. :smileywink:

That's worth some Kudos :smileywink:

 

 

Message Edited by dan_u on 02-28-2009 12:38 AM
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page