📄 uipgroup.~pas
字号:
unit UIPGroup;
interface
uses Windows, Messages, SysUtils, Variants, Classes,forms;
type
PIPSegment = ^TIPSegment;
TIPSegment=record
SegmentStr:string; //整个描述 :192.168.101.2-254
Head:string; //扫描的前面部分:如 192.168.101.
IPstart:intger; // 开始IP的最后一位:如 2
IPend:integer; // 结束IP的最后一位:如 254
end;
TIPGroup = Class
private
FIPSegmentStr:string;
FIPSegments:array of TIPSegment;
FCount:integer;
Function Get(Index: Integer):PIPSegment;
public
constructor Create( aIPSegmentStr: string='');
destructor Destroy; override;
procedure LoadSegments(aIPs:Tstrings);
Procedure SetSengments( aIPSegmentStr: string);
property IPSegmentStr:string read FIPSegmentStr write SetSengments;
property IPs[Index: Integer]: PIPSegment read Get ; default;
property Count:integer read FCount;
end;
implementation
{ TIPGroup }
constructor TIPGroup.Create(aIPSegmentStr: string='');
begin
FCount:=0;
setlength(FIPSegments,FCount);
FIPSegmentStr:='';
if aIPSegmentStr<>'' then
SetSengments(aIPSegmentStr);
end;
destructor TIPGroup.Destroy;
begin
FCount:=0;
setlength(FIPSegments,FCount);
inherited;
end;
function TIPGroup.Get(Index: Integer): PIPSegment;
begin
if (Index>-1) and (Index<FCount) then
result:= FIPSegments[Index]
else
result:=nil;
end;
procedure TIPGroup.LoadSegments(aIPs: Tstrings);
begin
SetSengments(aIPs.Text);
end;
procedure TIPGroup.SetSengments(aIPSegmentStr: string);
begin
if FIPSegmentStr=aIPSegmentStr then exit;
FIPSegmentStr:=aIPSegmentStr;
replace()
FCount:=0;
setLength()
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -