473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

auto timeout for winform application

I need to have a auto timeout feature for a webform application(vb.net).
Basically, I want to close the application if the user does not have a
keyboard or mouse input after a specific period of time. Please help!

Dayne
Jul 21 '05 #1
9 3244
"Dayne" <d_**********@hotmail.com> schrieb:
I need to have a auto timeout feature for a webform application(vb.net).
Basically, I want to close the application if the user does not have a
keyboard or mouse input after a specific period of time.


There's no need to post this more than once. You already got an answer:

HOWTO track a user's idle time
<URL:http://www.codeproject.com/dll/trackuseridle.asp>

<URL:http://groups.google.de/groups?selm=...2MSFTNGP11.phx.
gbl>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Jul 21 '05 #2
Hello Dayne,

Do you want to close the app if the user doesn't touch the App, or if the
user doesn't touch Windows?
There's a difference.

Let's say I use your app, then minimize it, and open up Excel. I type in
Excel for an hour. Should you app time out?
If not, then you need to hook the windows event. The article that Wayne
sent is appropriate.
If, on the other hand, you want to close because no one has touched your app
in an hour, then you can simply set a timer in your app and when you get
keystrokes or clicks, set the current datetime in a static location. When
your time goes off, check to see if "too long" has occured, and if so,
close.

One problem: it isn't clear if your app is ASP.NET or is a Windows forms
app. In your title, you way Winform, but in the text you say webform.

If it is a web form, you have a totally different problem.
--- Nick

"Dayne" <d_**********@hotmail.com> wrote in message
news:uY*************@TK2MSFTNGP12.phx.gbl...
I need to have a auto timeout feature for a webform application(vb.net).
Basically, I want to close the application if the user does not have a
keyboard or mouse input after a specific period of time. Please help!

Dayne

Jul 21 '05 #3
Use a javascript timer on the web client which should be reset each time a
user enters text or moves focus from one control to another, if the timer
event ever fires you can window.close()

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Dayne" <d_**********@hotmail.com> wrote in message
news:uY*************@TK2MSFTNGP12.phx.gbl...
I need to have a auto timeout feature for a webform application(vb.net).
Basically, I want to close the application if the user does not have a
keyboard or mouse input after a specific period of time. Please help!

Dayne

Jul 21 '05 #4
"Dayne" <d_**********@hotmail.com> schrieb:
I need to have a auto timeout feature for a webform application(vb.net).

Web Forms or Windows Forms?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Jul 21 '05 #5
The title of the OP's post says Winform, but in the text he says WebForm

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
"Dayne" <d_**********@hotmail.com> schrieb:
I need to have a auto timeout feature for a webform application(vb.net).

Web Forms or Windows Forms?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Jul 21 '05 #6
I am doing a winform application(desktop application). I want to close
the application if there is no key stroke between ( from my application
or any other ) a define period.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #7

I am doing a window application.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #8

Winform

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #9
Dayne,

Assuming it is a windowform, than I think that you can use something as this
beneath when it is a webform you can do as Terry told, in is almost the same
way as this. And please stay as Herfried told as well next time in the
original question thread.

\\\Need a webform and some controls however a button and a textbox as
minimum
Private WithEvents mytimer As New Windows.Forms.Timer
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
doSet(Me)
End Sub
Private Sub doSet(ByVal parentCtr As Control)
Dim ctr As Control
For Each ctr In parentCtr.Controls
AddHandler ctr.Click, AddressOf eventfired1
AddHandler ctr.Enter, AddressOf eventfired1
AddHandler ctr.KeyDown, AddressOf eventfired2
doSet(ctr)
Next
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles mytimer.Tick
Me.Close()
End Sub
Private Sub eventfired1(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
eventfired()
End Sub
Private Sub eventfired2(ByVal sender As System.Object, _
ByVal e As Windows.forms.KeyEventArgs)
eventfired()
End Sub
Private Sub eventfired()
mytimer.Enabled = True
mytimer.Stop()
mytimer.Interval = 3000
mytimer.Start()
End Sub
///

I hope this helps a little bit?

Cor
Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: zbcong | last post by:
hello i write a simple winform app to test the NTD(no-touch deployment) feature of dot net,after deploy it to the iis server,it works well,i can invoke it from either commandline or ie browser. ...
1
by: Michelle | last post by:
Hi All, I have an ASP.NET application with a session timeout of 20 minutes - for security reasons. I have a web form in this application that I need to Auto Save every 15 minutes (in case the...
3
by: Woody Splawn | last post by:
I have been experimenting with Auto Slides and TreeViews and find them most usefull in Winforms. I know how to create a Treview and have it, for example, slide out from the left of my Winform but...
5
by: Dayne | last post by:
I need to have a auto timeout feature for a webform application(vb.net). Basically, I want to close the application if the user does not have a keyboard or mouse input after a specific period of...
24
by: aam | last post by:
hi, im trying to figure out how i can program the mouse to automatically click on a button of a web page that i'm viewing.i do not have control over the page.i would also like to set up an...
1
by: reidarT | last post by:
I have an application (winform vb.net 2005) installed on some computers. There is a connection to an sql server on the companys server. This works OK on all machines except one, where I get the...
4
by: jgamble | last post by:
I'm working for the first time on an existing application that communicates with an SQL Server database. We've backed up the database and installed it on our own machine, and copied the ADB file...
4
by: Smithers | last post by:
Using .NET 2.0... How can I cause Windows Forms application to shut itself down after a period (say 15 minutes) of ? Specifically, I'm wanting some options for detecting that the user is somehow...
2
by: Dean Slindee | last post by:
"The timeout period elapsed prior to completion of the operation or the server is not responding". ExceptionType: System.Data.SqlClient.SqlException Method: OnError I am getting the above error...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.