02-24-2009 05:02 PM
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.
Solved! Go to Solution.
02-25-2009 03:10 AM
02-25-2009 08:02 AM - edited 02-25-2009 08:03 AM
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?
02-25-2009 09:36 AM
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.
02-25-2009 03:26 PM
Yes - that is what I am looking for.
Thanks KristenC!