Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 4 - 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 
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 / 3
    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 - Retrieving the Workstation Name


    (Page 4 of 4 )


    The function below retrieves the computer or workstation name, which is then saved and sent to the server when connecting:


    //********computername

    function TForm1.GetComputerName: string;

    var

    buffer: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;

    Size: Cardinal;

    begin

    Size := MAX_COMPUTERNAME_LENGTH + 1;

    Windows.GetComputerName(@buffer, Size);

    Result := StrPas(buffer);

    end;

    //*********end comp name function

    The message synchronization functions have already been explained and should be easy to understand when looking through the code. The Dosychronize procedure is where the messages from the server are analyzed and processed. The server will send one of three commands, which this procedure needs to break down and execute:

    //****** message synchronization functions

    constructor TLog.Create(const AMsg: String);

    begin

    FMsg := AMsg;

    inherited Create;

    end;


    procedure TLog.DoSynchronize;

    var

    cmd,mins,wstation:string;

    begin

    parsestring(FMsg,cmd,wstation,mins);

    if cmd = 'activate' then begin

    //remove screenblock

    form1.Visible:=false;

    form1.setoff:=true;

    form2.times:=strtoint(mins);

    form2.label1.caption:=mins;

    form2.show;

    end

    else

    if cmd='shutdown' then

    begin

    //initiate shut down

    if not TimedShutDown(form1.GetComputerName, 'you have to shutdown', 30, true, true) then

    ShowMessage('function failed...');

    end

    else

    if cmd='lockstation' then

    begin

    //lock workstation

    if not form1.Visible then

    begin

    form1.Visible:=true;

    form1.setoff:=true;

    end;

    end;

    end;


    class procedure TLog.AddMsg(const AMsg: String);


    begin


    with Create(AMsg) do try

    Synchronize;

    finally

    Free;

    end;

    end;

    Conclusion

    In the next article we will continue to explore some of the remaining procedures and functions.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - 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...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek