通过Windows ActiveX控件自动注销Web应用程序 [英] auto log off web application through windows ActiveX control

查看:104
本文介绍了通过Windows ActiveX控件自动注销Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要帮助或专注于通过c#中的Windows ActiveX控件自动注销Web应用程序.这样做是可行的.与之相关的想法.

谢谢,
Brinda

Hi,

I need assistance or focus that auto log off web application through windows ActiveX control in c#. It is feasible to do. And idea related to it.

Thanks,
Brinda

推荐答案


您可以在C#.NET中使用计时器控件来实现此目的,然后再生成 Deactivate&已激活 Window窗体的事件,并在下面的
中实现
Hi,
you can achieve this using timer control in C#.NET , before that generate Deactivate & Activated event for Window form and implement below in that
 private void Form_Activated(object sender, EventArgs e)
{
    timer1.Stop();
    timer1.Enabled = false;
}

private void Form_Deactivate(object sender, EventArgs e)
{
    timer1.Enabled = true;
    timer1.Tick += new EventHandler(timer1_Tick);
    timer1.Interval = 10000;
    // interval is in miliseconds.. current interval is for 10 sec
    timer1.Start();
}

void timer1_Tick(object sender, EventArgs e)
{
    if (timer1.Interval == 10000)
    // once there window found still deactivated for perticular interval
    {
        timer1.Stop();
        this.Close();
        // here you can log off the user & call the new window
    }
}


这篇关于通过Windows ActiveX控件自动注销Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆