The Client for an Internet Access Control Application
Recently we finished a series covering the server side for an Internet access control application; now we're ready to take on the client. The client application is what the Internet users will see shortly before a workstation is activated or when a session is completed. It is responsible for both time and user access management as you will see in the rest of the series. Crucially, it is also responsible for processing all communication between itself and the server.
The Client for an Internet Access Control Application - Small and Main Window (Page 2 of 4 )
The client has two parts. The first part is what a user will see when a session has started. This includes a small window that will tell the user how much time she has left for her session. And the other is the main window that shows the ads.
In the source code for the client, I’ve set the ads window to cover the entire screen. But you can of course modify it to suit. Also, when the ads window is set, keyboard and mouse access will be disabled. This is because you do not expect anyone to use the workstation concerned, and the workstation will only be activated if a session has been started for it. Below is a listing of the main code for the client application:
ShowMessage('Error adjusting process privileges.');
end
else
ShowMessage('Cannot find privilege value.');
end;
Result := InitiateSystemShutdown(PChar(Computer), PChar(Msg), Time, Force, Reboot)
end;
//**end shutdown function
The shutdown function, as the name suggests, is responsible for shutting down a connected workstation. When the shutdown code is executed, a timed shutdown dialog box will appear on the workstation's screen. Finally, the computer will be shut down.