Home arrow Delphi-Kylix arrow Page 2 - Finishing the Client for an Internet Access Control Application
DELPHI-KYLIX

Finishing the Client for an Internet Access Control Application


Last week we began our discussion of the client side of an Internet access control program. This week we'll continue to cover the important parts of the code. We'll start with the reading thread, then go to the ini file. Keep reading to be enlightened.

Author Info:
By: David Web
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
October 06, 2008
TABLE OF CONTENTS:
  1. · Finishing the Client for an Internet Access Control Application
  2. · Check the ini file
  3. · Code Explained
  4. · The Timer Window

print this article
SEARCH DEVARTICLES

Finishing the Client for an Internet Access Control Application - Check the ini file
(Page 2 of 4 )


The second thing that happens, just before the client connects, is that it checks to see if an ini file with the path to the ads directory exists:

procedure TForm1.FormShow(Sender: TObject);

var

settings : TINIFile;

begin

settings := TINIFile.Create(ExtractFilePath(Application.EXEName) + 'settings.ini');

try

path:=settings.ReadString('Path', 'pathdir', 'Empty');


finally

settings.Free;

end;

//check if path is set..

if path= 'Empty' then begin

//if path is not set in ini file then set the default path:

path:='intertimerstart.html';

end;

if form1.Visible then

begin

setof.Enabled:=true;

{ if form1.FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then

begin

BlockInput(true) ;

Sleep(10000) ;

BlockInput(false) ;

end; }

end

else begin

form1.Visible:=true;

if form1.FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then

begin

BlockInput(true) ;

Sleep(10000) ;

BlockInput(false) ;

end;

end;

end;


procedure TForm1.FormCreate(Sender: TObject);

begin{

tc.Host:='127.0.0.1';

tc.Port:=1150;

with tc do

begin

try

Connect;

Socket.WriteLn(edname.text+':free@plchldr');

//Socket.WriteLn(GetComputername+':free@plchldr');

except on E : Exception do

showmessage('Could not connect to remote host. Check to see if you entered the right IP address');

end;

end; }

end;


procedure TForm1.Button1Click(Sender: TObject);

begin

showWindow(findwindow('shell_traywnd',nil), sw_show);

end;


procedure TForm1.FormActivate(Sender: TObject);

begin

// wb.Navigate(path);

end;


procedure TForm1.setofTimer(Sender: TObject);

begin

//if setoff is false then block mouse/keyboard access..

if not setoff then

begin

if FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then

begin

BlockInput(true) ;

end;

end

else

//setoff is true, enable mouse/keyb access

begin

if FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then

begin

BlockInput(false);

// form1.Timer1.Enabled:=false;

end;


end;

end;

end.


blog comments powered by Disqus
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...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials