ผมกำลังหา componant - DCPCrypt ใน delphixe อยู่ครับ คงตอบโจทย์ข้อนี้ได้ครับ
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=459.0ตอนนี้ผมเขียนแบบนี้ครับ
if RzEdit2.Text = 'xxxxx' then
begin
Formlogin.Hide;
if formmain = nil then
Application.CreateForm(Tformmain,formmain);
MessageDlg('Programmer Mode', mtInformation, [mbOK], 0);
with FormMain do
begin
RzEdit1.Text:=Self.RzEdit1.Text;
RzEdit2.Text:=Self.RzEdit2.Text;
RzEdit3.Text:='0';
dxRibbonStatusBar1.Panels[0].Text:='ProgrammerMode';
Show;
end;
//Close;
//Abort;
end;
if (RzEdit1.Text<> '' ) and (RzEdit2.Text <> '' ) then
begin
with MyQuery1 do
begin
Close;
sql.Text := 'select * from hospital_member where loginname =:vlogin and password =:vpassword ';
Params.ParamValues['vlogin'] := trim(RzEdit1.Text);
Params.ParamValues['vpassword'] :=trim(RzEdit2.Text);
Open;
end;
if not MyQuery1.eof then
begin
Formlogin.Hide;
if formmain = nil then
Application.CreateForm(Tformmain,formmain);
with FormMain do
begin
RzEdit1.Text:=Self.MyQuery1['personcode'];
RzEdit2.Text:=Self.MyQuery1['name'];
RzEdit3.Text:='0';
dxRibbonStatusBar1.Panels[0].Text:=Self.myQuery1['loginname'];
show;
end;
//Close; }
end
else
begin
ShowMessage('ลองใหม่อีกทีจิ');
RzEdit2.Clear;
RzEdit2.SetFocus;
Abort;
end;