?? unit1.pas
字號:
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Classes, Controls,
Forms, Dialogs, StdCtrls, Buttons, CRC;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
Label3: TLabel;
OpenDialog: TOpenDialog;
Label4: TLabel;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
f: File;
CRC16: Word;
CRC32: LongInt;
CRCArc: Word;
procedure Error;
begin
Application.MessageBox('Open error.', 'I/O Error', mb_Ok or mb_IconStop)
end;
begin
if OpenDialog.Execute then
begin
if not FileCRC16(OpenDialog.FileName, CRC16) then
begin
Error;
Exit;
end;
Label1.Caption := 'CRC16 = ' + IntToStr(CRC16);
if not FileCRC32(OpenDialog.FileName, CRC32) then
begin
Error;
Exit;
end;
Label2.Caption := 'CRC32 = ' + IntToStr(CRC32);
if not FileCRCArc(OpenDialog.FileName, CRCArc) then
begin
Error;
Exit;
end;
Label4.Caption := 'CRCArc = ' + IntToStr(CRCArc);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -