PortScan.pas
上传用户:hbtcygglw
上传日期:2007-01-07
资源大小:281k
文件大小:1k
- unit PortScan;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, StdCtrls, Buttons, NMUDP, Spin;
- type
- TScannerDlg = class(TForm)
- SendList: TListBox;
- Splitter1: TSplitter;
- RecvList: TListBox;
- btnScan: TBitBtn;
- BitBtn2: TBitBtn;
- edStartAddr: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- ScanUdp: TNMUDP;
- edAddrNum: TSpinEdit;
- procedure btnScanClick(Sender: TObject);
- private
- { Private declarations }
- procedure PingAddr(addr:string);
- public
- { Public declarations }
- class procedure Execute;
- end;
- implementation
- uses main;
- {$R *.DFM}
- procedure TScannerDlg.btnScanClick(Sender: TObject);
- var
- i:Integer;
- addr:string;
- begin
- for i:=1 to edAddrNum.Value do
- begin
- addr:=edStartAddr.Text+'.'+IntToStr(i);
- PingAddr(addr);
- PingAddr(addr);
- PingAddr(addr);
- end;
- end;
- class procedure TScannerDlg.Execute;
- begin
- with TScannerDlg.Create(Application) do
- begin
- ShowModal;
- Free;
- end;
- end;
- procedure TScannerDlg.PingAddr(addr: string);
- {var
- buf:array [0..2048] of char;
- i:Integer;}
- begin
- SendList.Items.Add('Scanning address:'+addr);
- end;
- end.