User connection through Script

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
filou
Posts: 22
Joined: Thu May 03, 2012 11:06 am

User connection through Script

Post by filou »

Hi,

For login, I have the user name "operator" and the password "111".

How is-it possible to login by using Script ?

Thank you
Philippe

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: User connection through Script

Post by mark.monroe »

Example below will log a user in when they press Button1.

Code: Select all

namespace Neo.ApplicationFramework.Generated
{
    using System.Windows.Forms;
    using System;
    using System.Drawing;
    using Neo.ApplicationFramework.Tools;
    using Neo.ApplicationFramework.Common.Graphics.Logic;
    using Neo.ApplicationFramework.Controls;
    using Neo.ApplicationFramework.Interfaces;
    
	using Neo.ApplicationFramework.Common.Service;
    
    public partial class Screen1
    {
		
		void Button1_Click(System.Object sender, System.EventArgs e)
		{
			//Login User
			ISecurityServiceCF securityServiceCF = ServiceContainerCF.GetService<ISecurityServiceCF>();
			securityServiceCF.LoginUser("operator", "111");
			
		}
		
		void Button2_Click(System.Object sender, System.EventArgs e)
		{
			//Logout User
			ISecurityServiceCF securityServiceCF = ServiceContainerCF.GetService<ISecurityServiceCF>();
			securityServiceCF.LogoutUser();
		}
    }
}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply