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 75 76 77 78
|
Procedure ReadTxt;
var
texte, str :string;
F : Textfile;
Begin
try
//AssignFile(F, chappli +'cincapip.html'); {Assigne le nom du fichier}
{ouvre le fichier pour lecture}
FServer.Mip.Lines.LoadFromFile(chappli +'cincapip.html');
Readln(F,str);
// Puis dernière découpe pour récupérer 83.201.180.27
If FServer.Ckid.checked then begin
STmpId := Copy(FServer.Mip.text, Pos('<a href="http://', FServer.Mip.text+':'+FServer.EDid.text) + 16, Pos('>', FServer.Mip.text) -1);
FServer.Mip.text := STmpId
end
else begin
STmp := Copy(FServer.Mip.text, Pos('<a href="http://', FServer.Mip.text) + 16, Pos('>', FServer.Mip.text) -1);
FServer.IPServer2.text := STmp;//Copy(Stmp, Pos('</a>',STmp)+1, Length(STmp));
end;
FServer.IPServer2.Hint := 'Ancien IP : ' + STmp ;//Copy(Stmp, Pos('</a>',STmp)+1, Length(STmp));
FServer.IPServer.Hint := 'Ancien IP : ' + STmp ;
finally
Closefile(F); {Ferme le fichier}
End;
end;
//Fin
//Procédure écriture du fichier text sur DD.
Procedure WriteTxt;
var
lst : TStringList;
sFileName : String;
F : Textfile;
begin
//lst := TStringList.Create;
//tourlourou
try
AssignFile(f, chappli + 'cincapip.html');
Rewrite(f);
WriteLn(f, '<!DOCTYPE html>');
WriteLn(f, '<html><!-- ' + DateTimeToStr(Now) + ' -->');
WriteLn(f, '<head>');
WriteLn(f, '<title>Votre IP</title>');
WriteLn(f, '</head>');
WriteLn(f, '<body><!-- ' + FServer.IPServer.text + ' -->');
WriteLn(F, '<!-- Votre IP -->Votre IP modifiée le : ' +datetostr(date) + ' à '+ timetostr(time));
WriteLn(f, '<br><br>');
If FServer.Ckid.checked then
WriteLn(f, '<a href="http://'+FServer.IPServer.text+ ':'+FServer.EDid.text+'">'+ FServer.IPServer.text +'')
else
WriteLn(f, '<a href="http://'+FServer.IPServer.text+'">'+ FServer.IPServer.text +'') ;
WriteLn(f, '</a>');
WriteLn(f, '</body>');
WriteLn(f, '</html>');
finally
CloseFile(f);
end;
end;
//Fin |
Partager