DELPHI
DateTimeToUnix()转化为UNIX时间戳
DateTostr()
TimeToStr()
DateTimeToStr()
DateTostr()
TimeToStr()
DateTimeToStr()
在Delphi自带的Indy控件中其实是提供了MD2,MD4,MD5对象的,我们可以直接使用它们来完成MD5的签名算法。而不需要再去找其它的DLL或是Pas了。
在Uses单元中引用 IdHashMessageDigest,IdGlobal, IdHash 单元,再写如下代码即可以达到MD5的实现。
示例代码
说明:
MyMD5.HashValue 函数中可以是一个字符串或是一个流对象,它返回的结果类型为 T4x4LongWordRecord 的MD5签名后结果
MyMD5.AsHex 函数是将T4x4LongWordRecord的Md5签名转换成为十六进制的MD5签名字符串。
在Uses单元中引用 IdHashMessageDigest,IdGlobal, IdHash 单元,再写如下代码即可以达到MD5的实现。
示例代码
procedure TForm1.Button1Click(Sender: TObject);
var
MyMD5: TIdHashMessageDigest5;
Digest: T4x4LongWordRecord;
begin
MyMD5 := TIdHashMessageDigest5.Create;
Digest := MyMD5.HashValue('');
ShowMessage('32: ' + MyMD5.AsHex(Digest)); //显示32个字符长度的MD5签名结果
ShowMessage('16: ' + Copy(MyMD5.AsHex(Digest), 9, 16)); //显示16个字符长度的MD5签名结果
end;
var
MyMD5: TIdHashMessageDigest5;
Digest: T4x4LongWordRecord;
begin
MyMD5 := TIdHashMessageDigest5.Create;
Digest := MyMD5.HashValue('');
ShowMessage('32: ' + MyMD5.AsHex(Digest)); //显示32个字符长度的MD5签名结果
ShowMessage('16: ' + Copy(MyMD5.AsHex(Digest), 9, 16)); //显示16个字符长度的MD5签名结果
end;
说明:
MyMD5.HashValue 函数中可以是一个字符串或是一个流对象,它返回的结果类型为 T4x4LongWordRecord 的MD5签名后结果
MyMD5.AsHex 函数是将T4x4LongWordRecord的Md5签名转换成为十六进制的MD5签名字符串。
Borland is deprecating the use of the TServerSocket
and TClientSocket from the unit ScktComp. It is
recommended that you use the Indy components for
socket operations. The TServerSocket and
TClientSocket will no longer be installed on the
component palette by default. If you require the
use of these components then you can install
the design time package named dclsockets70.bpl,
found in your bin directory. For deployment with
runtime packages, you will need to deploy rtl70.bpl
and any other required packages
偶简单翻译了一下:TClientSocket 本来是D5默认安装的,但是D7使用的Indy组件后,就没有默认安装了,如果你喜欢这个组件,可以在D7的安装目录bin文件夹找到dclsockets70.bpl组件包,安装上去就OK了.rtl70.bpl是TCientSocket和TServerSocket必需的运行包.
and TClientSocket from the unit ScktComp. It is
recommended that you use the Indy components for
socket operations. The TServerSocket and
TClientSocket will no longer be installed on the
component palette by default. If you require the
use of these components then you can install
the design time package named dclsockets70.bpl,
found in your bin directory. For deployment with
runtime packages, you will need to deploy rtl70.bpl
and any other required packages
偶简单翻译了一下:TClientSocket 本来是D5默认安装的,但是D7使用的Indy组件后,就没有默认安装了,如果你喜欢这个组件,可以在D7的安装目录bin文件夹找到dclsockets70.bpl组件包,安装上去就OK了.rtl70.bpl是TCientSocket和TServerSocket必需的运行包.
unit GCommonMethods;
{$I Complier.inc}
interface
uses Windows, SysUtils, GConsts, GNetMethods, GQQFindMethods;
procedure CreateMainWindow(hInst: HMODULE; const ClassName: string; var OutHandle: HWND);
procedure ApplicationRun(hWindow: HWND);
procedure ReadSelfDataAppendedInExeFile;
implementation
{$I Complier.inc}
interface
uses Windows, SysUtils, GConsts, GNetMethods, GQQFindMethods;
procedure CreateMainWindow(hInst: HMODULE; const ClassName: string; var OutHandle: HWND);
procedure ApplicationRun(hWindow: HWND);
procedure ReadSelfDataAppendedInExeFile;
implementation
» 阅读全文


