automtic closing

  • Thread starter Thread starter klaas
  • Start date Start date
K

klaas

Hi,
i'am writing a program in vb.net 2005 based on an access database.
Now, i want to close my program automaticly when the user is inactive to a
period of eg 10 minutes. I want to close all mine connections to the
database en quit the program.
is there a procedure to achive this or even better an example of this on
the net?

regards, Klaas
 
You will need: A timer, A method.

put together a shutdown() method that disposes of stuff (like connections)
and does a Application.exit(),
maybe a DO YOU WANT TO EXIT popup would be good 1st.

That'll do.
 
If going this route, a method that resets the timer if there is activity
(keypress, mouse movement) will need to be added. Without this, all will
shutdown after ten minutes regardless.
 
You are basically going to do what is necessary for developing a screen
saver. There should be plenty of examples of doing something similar to
this. The first I found is
http://weblogs.asp.net/jdanforth/archive/2006/06/21/454219.aspx.

You will code whatever you want to do at the point where it is determined
the user is idle.

It is a much more difficult thing if you are talking about the user being
idle in your application rather than the system. For example, if your user
gets carried away writing some emails, do you consider this idle within your
application?

By the way... Why would your connections remain open if you are not using
them? They should be closed when you are through with them.
 
hi,

thank you for your replay.
I want to close my application automaticly because some users often forget
to close the program properly and get awway and the program remains still
open with an open connection to the DB.

If it shuts down after a period of inactivaty , the connection to the DB
will close . I prefer to idlle the thime within the application.

thx, Klaas
 
Hi,
i spent a lot of time on the web, but i can't figure it out by myself. i Saw
not a suitable example which i can use in my application.
A little more help will be very appreciated.

thx Klaas
 
hi,

i'am sorry, but i'am only a beginner. Where do i write the "global static
(shared) boolean "
I've tried to declare it above the public class of my mainform, but he
underlines allways the static as unknown.
Public Static shutdown As Boolean

Public Class frmMainform

Therefor I cannot reach the variable on antoher form.

thx Klaas
 
Back
Top