NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Skipping log-in form from .net

Solved!
Go to solution

Hello - I am evaluating TestStand the first time to check if it fits the need of our application and I encounter this question hope anybody can help me.

I am creating custom interface that will use TestStand objects. My question is how will I be able to log-in programmatically upon starting of Application Manager?

Basically, my goal is we have our own user level access and there's no need for the TestStand to display their own log-in.

 

 

0 Kudos
Message 1 of 5
(3,816 Views)
Hello MDB, if you want to have the other level access you can click the User Manger button on toolbar to creat other users like an operator user. If you just want to change the Log in interface, you can have your own Log in interface with a name and password  blanks, you can check this link for further helps:)
********************************
*The best Chinese farmer*
********************************
0 Kudos
Message 2 of 5
(3,807 Views)

Thanks for the reply Paulbin but that is not what I am looking for.

 

My .net application have its own log-in. What I am trying to do is I when I launch the application manager from my .net I dont want the TestStand log-in to pop-up.

Is there any way that I can start the application manager without displaying the log-in? Or some sort of passing the username and password programatically - like when you are connecting to SQL?

 

 

Message Edited by mbd on 02-25-2009 08:03 AM
0 Kudos
Message 3 of 5
(3,802 Views)

You can tell the application manager not to log in on start.  Then you can programmatically use Engine methods to get the User of a certain username, verify the password, and set the current User.

 

For example, you could do something like the following in the  MainForm_Load method, right before you start the application manager:

 

  axApplicationMgr.LoginOnStart = false;

                string password = "";

                string username = "Administrator";

                User userToLogIn = axApplicationMgr.GetEngine().GetUser(username);

                if(userToLogIn != null)

                {

                    if (userToLogIn.ValidatePassword(password))

                        axApplicationMgr.GetEngine().CurrentUser = axApplicationMgr.GetEngine().GetUser("Administrator");

                    else

                        MessageBox.Show("Invalid Password");

                }

                else

                {

                    MessageBox.Show("Invalid Username");

                }

axApplicationMgr.Start();

 

Let me know if you have any questions or if this is not what you are looking for. 

 

Kristen
National Instruments
Message 4 of 5
(3,796 Views)
Solution
Accepted by -mbda-

Yes - that is what I am looking for.

 

Thanks KristenC!

0 Kudos
Message 5 of 5
(3,784 Views)