Delphi 官方 MD5
- 作者: 五速梦信息网
- 时间: 2026年04月04日 13:45
去官方文档搜就行了,引入System.Hash 单元:
http://docwiki.embarcadero.com/Libraries/Athens/en/System.Hash.THashMD5
-----------------------------------------------------------------------------------------------
unit Unit4;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.Hash, System.NetEncoding;
type
TForm4 = class(TForm)
edt1: TEdit;
btn1: TButton;
edt2: TEdit;
lbl1: TLabel;
lbl2: TLabel;
lbl3: TLabel;
procedure btn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.btn1Click(Sender: TObject);
begin
//THashMD5 是个记录,GetHashString是个类方法,所以可以这样直接使用,不用创建和释放
edt2.Text := THashMD5.GetHashString(Trim(edt1.Text));
end;
procedure TForm4.FormCreate(Sender: TObject);
begin
ReportMemoryLeaksOnShutdown := true;
end;
end.

相关文章
-
Delphi 使用之连接数据库
Delphi 使用之连接数据库
- 互联网
- 2026年04月04日
-
delphi 线程池基础 TSimplePool
delphi 线程池基础 TSimplePool
- 互联网
- 2026年04月04日
-
delphi10做漂亮界面
delphi10做漂亮界面
- 互联网
- 2026年04月04日
-
Delphi ADOQuery连接数据库的查询、插入、删除、修改
Delphi ADOQuery连接数据库的查询、插入、删除、修改
- 互联网
- 2026年04月04日
-
delphi 7 wideString תstring
delphi 7 wideString תstring
- 互联网
- 2026年04月04日
-
Delph 获得窗口句柄
Delph 获得窗口句柄
- 互联网
- 2026年04月04日






