Hello, I am looking for a component to control the access to Internet and bill the time of a connection, I need to set the time of a connection to Internet, what do you recommend to me ?
Whatever components you use you will have to tell that component to connect at some point so just start a timer when you successfully connect. Set the timer event to disconnect if thats what you want after whetever period of time you require has elapsed.
As for working out a bill, it depends on how much you service provider charges per minute (if its not a standard monthly charge) so just multiply the cost per minute by the number of minutes you are connected for. Arte Et Labore
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
Edit1: TEdit;
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
procedure go;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.go;
var
yontem: OleVariant;
begin
yontem := 0;
WebBrowser1.Navigate(WideString(edit1.Text),yontem,yontem,yontem,yontem);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
go;
end;
end.
example 2 internet status
----------
uses wininet;
function UserOnline:boolean;
var
connect_status:dword;
begin
connect_status := 2 {lan} +
1 {modem} +
4 {proxy} ;
result := InternetGetConnectedState(@connect_status,0);
end;
if UserOnline = true then ShowMessage('Internet connection stat: Online')
else
ShowMessage('Internet connection stat: Offline');
example 3 (address verification)
---------
uses wininet;
function CheckUrl(url:string):boolean;
var
hSession, hfile, hRequest: hInternet;
dwindex,dwcodelen :dword;
dwcode:array[1..20] of char;
res : pchar;
begin
if pos('
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.