Purpose: This document describes the code required to initialize the session locking feature of the StrataFrame Security module.
Initializing Session Locking
The SessionLock class contains the code necessary to enable the session locking feature of the StrataFrame Security module. The SessionLock.StartSessionMonitoring() method is used to insert the low-level API hooks into the Windows process to allow the SessionLock class to track user input and monitor the session timeout. The full details of the SessionLock class can be found here.
In addition to inserting the low-level hooks and starting the session monitoring, the session lock class contains the SessionLockKey property that allows you to specify a key or key combination that can be used to quickly lock the application on a terminal just as if the end-user’s session had timed out.
The following sample shows the code that should be added to the InitApplication() method within the AppMain.vb (Program.cs) file to start the session monitoring and enable session locking within the application.
Imports MicroFour.StrataFrame.Security.BusinessObjects ... Private Shared Sub InitApplication(ByVal e As InitializingApplicationEventArgs) '-- Add the low-level hooks to start the session monitoring SessionLock.StartSessionMonitoring() '-- Set the quick lock key to F11 (or any other key) SessionLock.SessionLockKey = Keys.F11 End Sub
using MicroFour.StrataFrame.Security;
...
private static void InitApplication(InitializingApplicationEventArgs e)
{
//-- Initialize the session locking
SessionLock.StartSessionMonitoring();
SessionLock.SessionLockKey = Keys.F11;
}