automtic closing

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
 
S

simon-john roberts

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.
 
F

Family Tree Mike

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.
 
F

Family Tree Mike

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.
 
K

klaas

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
 
K

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
 
K

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top