Delphi生成字符字典的代碼,本人在整理Delphi代碼時候發現的,代碼簡單,有需要生成字符字典的可作為一個參考吧:
01
unit
Unit1;
02
interface
03
uses
04
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
05
Dialogs, Math, StdCtrls;
06
type
07
TForm1 =
class
(TForm)
08
Memo1: TMemo;
09
Button1: TButton;
10
procedure
Button1Click(Sender: TObject);
11
private
12
MakePass;
13
public
14
{ Public declarations }
15
end
;
16
var
17
Form1: TForm1;
18
const
19
StartLEn =
1
20
Endlen =
3
21
srcDictString = ‘abcd’;
22
implementation
23
{$R *.dfm}
24
{ TForm1 }
25
TForm1
.
26
27
nRect:
Integer
28
nCount:
29
nTotal:
Double
30
I, J, K:
31
nIndex:
array
of
32
chPass:
char
33
strTemp:
string
34
begin
35
nCount := Length(srcDictString);
36
for
I := StartLEn
to
Endlen
do
37
nTotal := Power(nCount, I);
38
SetLength(nIndex, I);
39
SetLength(chPass, I);
40
J :=
0
Trunc(nTotal) –
41
K :=
I –
42
if
(nIndex[K] = nCount)
then
43
nIndex[K] :=
44
K < I –
45
nIndex[K +
] := nIndex[K +
] +
46
47
48
49
chPass[I - K -
] := srcDictString[nIndex[K] +
];
50
51
nIndex[
] := nIndex[
52
strtemp :=
(@chPass[
]);
53
Memo1
Lines
Add(strTemp);
54
55
56
57
58
59
60
61
本實例實現的功能是能夠從用戶選擇的可執行文件(
一、引言我們知道視頻聊天軟件的關鍵技術在於采集
//放置控件: ClIEntDataSet1、DataSo
點擊OK後。保存項目命名為jksms.dpr.新建一個自動
本例效果圖: 代碼文件:unit Unit1;inte