Delphi-Kylix
  Home arrow Delphi-Kylix arrow The Client for an Internet Access Control ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

The Client for an Internet Access Control Application
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-09-29

    Table of Contents:
  • The Client for an Internet Access Control Application
  • Small and Main Window
  • Disable Mouse and Keyboard Access
  • Retrieving the Workstation Name

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Client for an Internet Access Control Application


    (Page 1 of 4 )

    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.

    How does it work?

    The client application will be running on the workstations and will be activated when these workstations are switched on. At some point in the series of articles, we will be creating a Windows service which will be responsible for activating the client application.

    Once the client application is activated, it will automatically try to connect to the server application. If it is successful in doing so, it will send the computer name to the server; if it is not successful in its attempt to connect, a timer will be set to try connecting to the server every minute for as long as the client application is active. While all of the above is going on, the client application will block access to both the keyboard and mouse. Once the client application connects to the server, it will then wait for any requests or commands from the server for processing.

    So, when the client application is started, it does the following:

    • Tries connecting to server every minute.

    • Blocks keyboard and mouse access.

    • Reads path to ads and set the path variable.

    • Activates browser control to show ads.

    The server will send one of two communications:

    session information – this request contains the time allocated for the session and also the name of the computer for which the session is allocated.

    shutdown command – This command essentially shuts down the workstation

    Because of the way our communication protocol works, we need to put code into the client application that is capable of handling simultaneous communication. This means that we need to divert client communication away from the main VCL thread. As we’ve already established in the previous articles, the main VCL thread is not thread safe. We therefore need to create a separate thread for client server communication.

    The code that we are going to use for this exercise will be exactly the same as that of the server. The only difference will be that we will create an extra thread to continually read any communication from the server. We will call this thread the ReadingThread. It has the following definition:


    TReadingThread = class(TThread)

    protected

    FConn: TIdTCPConnection;

    procedure Execute; override;

    public

    constructor Create(AConn: TIdTCPConnection); reintroduce;

    end;


    And the following implementation:


    constructor TReadingThread.Create(AConn: TIdTCPConnection);

    begin

    FConn := AConn;

    inherited Create(False);

    end;


    procedure TReadingThread.Execute;


    begin

    while not Terminated and FConn.Connected do

    begin

    // refer to my earlier message for this code...

    TLog.AddMsg(FConn.IOHandler.ReadLn);

    end;

    end;


    Below is a screen shot of the client application:



    The above is a screen shot of what the client looks like at the time of designing. The finished version will not have the buttons or the edit box. Instead, it will fill the entire screen and the ads will dominate most of the screen.

    More Delphi-Kylix Articles
    More By David Web


     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT