lazarus1.1:一行代码完成MD5加密
在lazarus主站转悠了半天,才发现MD5加密好简单:
1、uses 部分加上md5
2、加密操作:Edit2.Text := MD5Print(MD5String(Edit1.Text));
源程序: unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, md5, ZConnection, ZDataset, db, dbf; type { TForm1 } TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; insert: TButton; Label1: TLabel; Label2: TLabel; procedure insertClick(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.insertClick(Sender: TObject); begin Edit2.Text := MD5Print(MD5String(Edit1.Text)); end; end.