Форум: "Основная";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];
ВнизМассивы и IP Найти похожие ветки
← →
Michael C (2002-03-13 15:01) [4]Вот весь код, Анатолий выручай... private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ResultSz,ResultSIP,ResultDIP: String;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
I,Z,E,B,K,PosSIP,PosDIP,L,M,Summ: Integer;
F1,FR: TextFile;
Str,N1,N2,N3,A,D,N,S,FStr: String;
Mas: array[1..4096] of Integer;
begin
AssignFile (F1,"C:\capture_Feb_5_2002_17_4_23_760.csv");
Reset (F1);
Readln (F1,Str);
Delete (Str,1,40) ;
AssignFile (FR,"c:\report.txt");
Rewrite (FR);
//While not eof(f1) do
For b:=1 to 1000 do
Begin
Readln(F1,Str);
N1:=Str;
N2:=Str;
N3:=Str;
For i := 1 to 3 do
Begin
PosSIP := pos(",",N1);
If PosSIP > 0 then
Delete(N1,1,PosSIP);
End;
PosSIP := pos(",",N1);
If (PosSIP > 0) then
ResultSIP := copy(N1,1,PosSIP-1);
For e := 1 to 4 do
Begin
PosDIP := pos(",",N2);
If PosDIP > 0 then
Delete(N2,1,PosDIP);
End;
PosDIP := pos(",",N2);
If PosDIP > 0 then
ResultDIP := copy(N2,1,PosDIP-1);
K := Pos(",", N3);
while K > 0 do
begin
N3 := Copy(N3, K+1, Length(N3));
K := Pos(",", N3);
end;
If ResultSIP <> "0.0.0.0" then
Begin
Memo1.Lines.Add(ResultSIP);
L:= LastDelimiter(".",ResultSip);
A:= copy(ResultSIP,L+1,3);
S:= copy(ResultDIP,L-12,L-1);
End;
Memo4.Lines.Add(A);
If S="192.168.33" then
Memo7.Lines.Add(S);
If ResultDIP <> "0.0.0.0" then
Begin
Memo2.Lines.Add(ResultDIP);
M:= LastDelimiter(".",ResultDIP);
D:= copy(ResultDIP,M+1,3);
N:= copy(ResultDIP,M-12,M-1);
End;
Memo5.Lines.Add(D);
If N="192.168.33" then
Memo6.Lines.Add(N);
If (ResultSIP <> "0.0.0.0") or (ResultDIP <> "0.0.0.0") then
Memo3.Lines.Add(N3);
If S="192.168.33" then
Mas[StrToInt (A)]:= Mas[StrToInt (A)]+ StrToInt(N3);
If N="192.168.33" then
Mas[StrToInt (D)]:= Mas[StrToInt (D)]+ StrToInt(N3);
FStr := A + " , " + IntTostr(Mas[StrToInt (A)]);
Writeln (FR,FStr);
End;
CloseFile(FR);
end;
end.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.006 c