本文整理自网络,侵删。
procedure TForm1.BtnLoginClick(Sender: TObject);begin With FDQueryUser do try Connection := FDConnecMain; Close; SQL.Clear; SQL.Add('Select * From USERS Where USERNAME=:NAME and USERPASS =: PSS'); ParamByName('NAME').AsString := EditUser.Text; ParamByName('PSS').AsString := EditPassword.Text; Prepared := True; Open; if Not IsEmpty then begin //登录成功 UName := FieldByName('USERNAME').AsString; UPas := FieldByName('USERPASS').AsString; UYetki := FieldByName('YETKI').AsString; Form2.ShowModal; end else begin TextM.Caption := '登录失败!';
end; finally FDQueryUser.Close; end;end;
相关阅读 >>
Delphi 将image组件的图片保存为jpg格式图片方法
Delphi createprocesswithlogonw用法
更多相关阅读请进入《Delphi》频道 >>