Log out user / Auto hibernate function

dotnet framework


  • 1. Updateing Datetime field
    Hi; I have a pocket pc app that allows users to select a date. The selection is in a string format; example: 08/21/2005. When I try to update the database, the date is put in as 01/01/1900 00:00:00. My SQL code snippet is: Admit_Date = convert(datetime," & tempdate & ",120) Where Admit_Date is the database field name, Tempdate is the user entered variable as string. Thanks in advance for all the help Dale
  • 2. Not installed for this user 2003
    Like the other thread I can't get VS2003 to launch. It says it is disabled. My issue is I am trying to transfer my copy from an old computer to a new one. With failure, I cannot even uninstall from the new computer. Does anyone from MS actually read and assist in these groups or am I a victim of MS greed and they won't let you upgrade hardware with out buying a completely new copy, and how do I get rid of this one since add/remove fails? Am I srewed when 2005 comes out in Novemeber because I have a bad install now and can't get rig of the registry entries since add/remove fails? Anyone know why MS doesn't want you to upgrade hardware, they make it clear they don't by the level of difficulty in moving programs from the old computer to the new.
  • 3. crystal reports
    Is the Visual Studio version of 'Crystal Reports' included with VS.NET Academic?
  • 4. Dot Net Intervieww Questions and answers
    Can anybody please refer me some links/sites from where I can download Dot Net questions and answers, FAQs and tutorials? Urgently needed...your help is very much appreciated. Thanks in advance
  • 5. internet connection
    Hope someone can help me please. I was trying to down load updates which was taking a long time. My internet connection disconnects after 20 minutes and I have to start all over again. How can I set it for much longer. I have windows xp.

Log out user / Auto hibernate function

Postby Tmljaw » Wed, 21 Jul 2004 22:06:02 GMT


Many people have asked this question, and I have tried the examples, but am still unable to get the result I want.

I am writing a windows form-based application (a staff database), which PR will be using to manage staff movements within the company. There will be lots of sensitive information that needs protecting from prying eyes.

I am writing the application in VB.NET Academic Version (2003).

I have written the "hibernate" function which sends the application to the system tray when the user selects "Hibernate" from the main menu. When they right click on the applications icon in the system tray, they can restore the application to the screen, but they must login first. This much is written.

However, if the user leaves their desk for 5 minutes (proving no interaction - even GetFocus() !), the system needs to execute the hibernate function, hence 'autohibernate'. This period of time should be able to be reduced or expanded to even 30 minutes or 30 seconds!

I need the code that fires the sub 'Hibernate' when the user hasn't been using the system for given period of time.

I have tried the Application.Idle, but this wont tell me when there is interaction, which is equally as important. If, at any time, the application is not firing messages, then the application is seen as idle. However, at any point between checks the system could be non-idle, in which case I would need to be able to reset a counter which defines the whole period of time that I want the system to be certain that there is no interaction for.

So, I am assuming that every second, the system checks the idle status (how do I check this to be non-idle). If it is idle, then the counter is increased. If it is non-idle, then the counter is reset. If the counter reaches its time (total time/1second), then the timeout has been reached.

I do not wish to have to write the mousemove,mouseclick,keydown (etc) events for every object in my application as this will get messy and unreliable.

I tried the following code as a class, then the code that follows it is incorporated into sub main () where the system runs the actual application, the problem is that the prefiltermessage is never executed?? Why??

Imports System.Windows.Forms

Public Class clsAppIdleTimer

Implements System.Windows.Forms.IMessageFilter

Delegate Sub TimeoutDelegate()
Public Shared Event AppTimeout As TimeoutDelegate

Private m_timer As New Timer

Public Sub New(ByVal TimoutInterval As Integer)
AddHandler m_timer.Tick, AddressOf TimerProc

m_timer.Interval = TimoutInterval
m_timer.Enabled = True
End Sub

Sub Dispose()
m_timer.Enabled = False
End Sub

Private Shared Sub TimerProc(ByVal myObject As Object, ByVal myEventArgs As EventArgs)
RaiseEvent AppTimeout()
End Sub

Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean _
Implements System.Windows.Forms.IMessageFilter.PreFilterMessage

Select Case m.Msg
Case &H200 To &H209, &H100 To &H108 ' mouse, key events
m_timer.Enabled = False
m_timer.Enabled = True
End Select

End Function

End Class

... and now the sub main, which exists in a global module ...

Public Sub Main()
'we have the main Sub Main Code Here!

' idle.CreateDelegate(system.Type.Get

Similar Threads:

1.Auto standby and auto hibernate

I have HP Pavilion m400y desktop with Windows Xp PROF. I have tried several 
things using Control Panel-Power Scheme but my computer does not go in 
Hibernate or Standby mode after preset idle time. I need HELP please.

2.LoginView does not show a logged in user as being logged in

Using Website | ASP.NET Configuration, I set up a role name Administrators 
and a user named admin. In my application, I put a LoginView Conrol on my 
master page. The LoginView control has an anonymous Template, and a 
<RoleGroup> with Roles = "Administrators"

The login accepts the credentials of admin when they are entered correctly; 
however the status of the LoginView conrol continues to say "You are not 
logged in." Can someone suggest a way of troubleshooting this issue?



3.Logging when user logs on - ASPNET 2.0

I need a way to record when a user log on to my website, even if he returns 
eventually and he had set the "Remember me" form cookie. I basically want to 
known when someone actually use my application and when. I also want to have 
that information only once per visit.

For exemple if the user register with my website then I want to be notified 
once. Then the next time, and everytime after that, when he come back I want 
to receive a notification again, but only once. If he click the checkbox 
"Remember Me" in the "Login" control I want to known that he came back to my 

I have tried to use the "FormsAuthentication_OnAuthenticate" in the 
"Global.asax" but this event is fired numerous time per request and I dont 
even have access to the Session object to set a flag.

Please help!

4.Allow Click-Once app run by Non-Admin user to log in event log

We create a new eventlog for our inhouse apps, and we all our clickonce (C#) 
apps are writting in the event log, if the user is a local ADMIN.

but for non-admin users, our apps are unable to write to any event log.

how to allow a click once apps to write in an event log for non-admin user?

Here's our code:

if (!EventLog.SourceExists("Enterprise Library Logging"))
                EventLog.CreateEventSource("Enterprise Library Logging", 

            EventLog elog = new EventLog();
            elog.Log = "UAP";
            elog.Source = Application.ProductName;
            elog.MaximumKilobytes = 102400; // Comme les autres EVENT LOG.
            elog.WriteEntry("App STARTED", EventLogEntryType.Information);

5.Auto Shipping Auto Shipping Scheduling:car moving auto transport

6. Dispalying Welcome User to logged in user

7. How auto log out after 30 min inactivity?

8. Auto Log Out Question

Return to dotnet framework


Who is online

Users browsing this forum: No registered users and 56 guest