1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
unit arpmethod;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
Grids;
type
{ TFormarpmethod }
TFormarpmethod = class(TForm)
ARPStatusMemo: TMemo;
FixXPortButton: TButton;
FixXPortGroupBox: TGroupBox;
IPEdit: TEdit;
FreeIPsLabel: TLabel;
ChooseIPGroupBox: TGroupBox;
InstructionsMemo: TMemo;
InstructionsLabel: TLabel;
StatusLabel: TLabel;
IPsInUseGroupBox: TGroupBox;
AssignedIPsLabel: TLabel;
FindIPsButton: TButton;
AssignedIPsStringGrid: TStringGrid;
FreeIPsStringGrid: TStringGrid;
RandomlyChooseIPButton: TButton;
procedure FormShow(Sender: TObject);
procedure FindIPsButtonClick(Sender: TObject);
private
public
end;
var
Formarpmethod: TFormarpmethod;
implementation
uses
Unit1,Process;
{ TFormarpmethod }
procedure TFormarpmethod.FindIPsButtonClick(Sender: TObject);
var
s : ansistring;
begin
//See if arp command is available
//if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
ARPStatusMemo.Lines.Add('Running arp');
Application.ProcessMessages;
if RunCommand('arp',['-a'],s) then begin
ARPStatusMemo.Lines.Add(s);
//writeln(s);
end else
ARPStatusMemo.Lines.Add('The arp command cannot be accessed. Install it, or check the PATH.');
end;
procedure TFormarpmethod.FormShow(Sender: TObject);
begin
ARPStatusMemo.Clear;
ARPStatusMemo.Font.Name:=FixedFont;
end;
initialization
{$I arpmethod.lrs}
end.
|