Kan man lave en kode i Delphi 6 der gør at Internet opkoblingen afbrydes efter f.eks 5 min?
Jeg udlover 200 UP til det bedste svar!!!!
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
edtEntry: TEdit;
edtUser: TEdit;
edtPass: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses shellapi;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
cmd, par, fil, dir: PChar;
begin
cmd := 'open';
fil := 'rasdial.exe';
par := PChar(edtEntry.Text + ' ' + edtUser.Text + ' ' + edtPass.Text);
dir := 'C:';
ShellExecute(Self.Handle, cmd, fil, par, dir, SW_SHOWMINNOACTIVE);
end;
procedure TForm1.Button2Click(Sender: TObject);
var
cmd, par, fil, dir: PChar;
begin
cmd := 'open';
fil := 'rasdial.exe';
par := PChar(edtEntry.Text + ' /DISCONNECT');
dir := 'C:';
ShellExecute(Self.Handle, cmd, fil, par, dir, SW_SHOWMINNOACTIVE);
end;
Mess With The Best, Die Like The Rest ! :-)