
31.05.2013, 11:03
|
Прохожий
|
|
Регистрация: 30.05.2013
Сообщения: 3
Версия Delphi: Delphi 7
Репутация: 10
|
|
Результат
Спасибо еще раз, вот так, если кому то понадобится, получилось
Код:
var name:string; f:file; i,j:integer; mas: array of byte;
begin
assignfile(f,path);
FileMode:=fmOpenRead;
reset(f,1);
SetLength(mas, FileSize(f));
blockread(f,Pointer(mas)^,Length(mas));
closefile(f);
for i:=0 to Length(mas)-1 do
begin
if (chr(mas[i])='R') and (chr(mas[i+1])='A') and (chr(mas[i+2])='S') and (chr(mas[i+3])='P') then
begin
name:=chr(mas[i])+chr(mas[i+1])+chr(mas[i+2])+chr(mas[i+3]);
j:=4;
while chr(mas[i+j]) in ['A'..'Z','0'..'9','_',''''] do
begin
name:=name+chr(mas[i+j]);
j:=j+1;
end;
copyfile(pchar(path),pchar(edit2.Text+name+'.cer'),true);
exit;
end;
end;
end;
|