Question : Autologoff from C# app

Hello-

I want to adapt the code here to present my program's logon dialog box after a period of inactivity.

This works, except that instead of Application.Exit(), I want to present my Logon form. I can't figure out how to kill the EventHandler from firing once my form loads.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
ActivityMonitor.ActivityMonitor _am = new ActivityMonitor.ActivityMonitor();
_am.WarningMinutes = 0.9;
_am.MaxMinutesIdle = 1;
_am.Idle += new EventHandler(am_Idle); 

void am_Idle(object sender, EventArgs e)
{
    Application.Exit();
} 


If I place anything other than Application.Exit() in this location, mulitple instances of my form are created, no matter what I do to try to dispose of the EventHandler.

Any ideas/suggestions are welcome

Answer : Autologoff from C# app

The line "$albums = mysql_fetch_row($get_albums_sql);" fetches the first row already, you'll get all albums if you remove it.
Random Solutions  
 
programming4us programming4us