本文介绍了通过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

推荐答案

 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应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 19:08