6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
7 System.Classes, Vcl.Graphics,
8 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option,
9 FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
10 FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.MySQL,
11 FireDAC.Phys.MySQLDef, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf,
12 FireDAC.DApt, Vcl.ExtDlgs, Vcl.StdCtrls, Vcl.ExtCtrls, Data.DB,
13 FireDAC.Comp.DataSet, FireDAC.Comp.Client, System.Rtti,
14 System.Bindings.Outputs, Vcl.Bind.Editors, Data.Bind.EngExt,
15 Vcl.Bind.DBEngExt, Data.Bind.Components, Data.Bind.DBScope,
16 FireDAC.VCLUI.Wait, FireDAC.Comp.UI, Vcl.DBCtrls, Jpeg, Vcl.Grids,
18 FireDAC.Phys.IB, FireDAC.Phys.IBDef, FireDAC.Phys.FB, FireDAC.Phys.FBDef,
23 FDConnection1: TFDConnection;
30 OpenPictureDialog1: TOpenPictureDialog;
31 BindSourceDB1: TBindSourceDB;
32 BindingsList1: TBindingsList;
33 LinkPropertyToFieldCaption: TLinkPropertyToField;
34 LinkControlToField2: TLinkControlToField;
35 FDGUIxWaitCursor1: TFDGUIxWaitCursor;
36 DBNavigator1: TDBNavigator;
37 DataSource1: TDataSource;
39 FDTable1ID: TIntegerField;
40 FDTable1NAME: TWideStringField;
41 FDTable1SOURCE: TBlobField;
49 BindSourceDB2: TBindSourceDB;
50 LinkControlToField1: TLinkControlToField;
52 LinkControlToField5: TLinkControlToField;
57 LinkControlToField4: TLinkControlToField;
62 procedure Button1Click(Sender: TObject);
63 procedure Button4Click(Sender: TObject);
64 procedure Button3Click(Sender: TObject);
65 procedure FormCreate(Sender: TObject);
66 procedure Button6Click(Sender: TObject);
67 procedure ComboBox1Select(Sender: TObject);
68 procedure CheckBox1Click(Sender: TObject);
69 procedure UpDown1Click(Sender: TObject; Button: TUDBtnType);
70 procedure Button5Click(Sender: TObject);
82 uses System.NetEncoding, IdHashSHA, IdHashMessageDigest;
86 procedure TForm1.Button1Click(Sender: TObject);
95 t := TResourceStream.Create(HInstance, 'Resource_' + i.ToString,
97 AppendRecord([i, Format('slide%d.jpg', [i])]);
99 FDTable1SOURCE.LoadFromStream(t);
108 procedure TForm1.Button3Click(Sender: TObject);
113 s := FDTable1.CreateBlobStream(FDTable1.FieldByName('source'), bmRead);
114 j := TJpegImage.Create;
116 Canvas.Draw(0, 0, j);
121 procedure TForm1.Button4Click(Sender: TObject);
127 until (Bof = true) and (Eof = true);
134 procedure TForm1.Button5Click(Sender: TObject);
136 Edit4.Text := '
\82Æ
\82é
\82Ë
\81`
\82Ç
\8d\86';
138 '<h1 style=color:maron;text-align:center;font-style:italic>
\82Æ
\82é
\82Ë
\81`
\82Ç
\8d\86</h1>';
139 Edit3.Text := '
\94n
\8e,
\88¢
\95Û,
\8e\80\82Ë,
\8eE
\82·';
140 Edit6.Text := 'admin';
141 ComboBox1.Text := 'info';
142 UpDown1.Position := 30;
143 UpDown1Click(nil, btNext);
144 CheckBox1.Checked := false;
150 procedure TForm1.Button6Click(Sender: TObject);
151 function hash(str: string): string;
153 with TIdHashSHA1.Create do
156 result := HashStringAsHex(str);
164 if Edit6.Text <> '' then
165 FDTable2.FieldByName('password').AsString := hash(hash(Edit6.Text));
170 procedure TForm1.CheckBox1Click(Sender: TObject);
174 if CheckBox1.Checked = true then
178 FDTable2.FieldByName('mente').AsInteger := i;
181 procedure TForm1.ComboBox1Select(Sender: TObject);
183 FDQuery1.Open('select * from dbname');
184 FDTable2.FieldByName('info').AsInteger := FDQuery1.Lookup('database',
185 ComboBox1.Text, 'dbnum');
189 procedure TForm1.FormCreate(Sender: TObject);
193 if FDTable1.Exists = false then
201 ComboBox1.Items.Clear;
204 Open('select * from dbname;');
207 s := FieldByName('database').AsString;
208 if s <> 'master' then
209 ComboBox1.Items.Add(s);
212 ComboBox1.Text := Lookup('dbnum', FDTable2.FieldByName('info').AsInteger,
216 CheckBox1.Checked := FDTable2.FieldByName('mente').AsInteger = 1;
217 UpDown1.Position := FDTable2.FieldByName('count').AsInteger;
221 procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);
223 FDTable2.FieldByName('count').AsInteger := UpDown1.Position;