用delphi做了一個霸氣的登陸界面

用數據庫記錄賬號的登陸功能 的實現
第一步配置con1控件

第二步配置adoquery1屬性

第三步:添加按鈕點擊事件
procedure TForm2.btn1Click(Sender: TObject);
begin
if (edt1.Text = '') or (edt2.Text = '')then
ShowMessage('賬號或密碼不能為空')
else
begin
With ADOQuery1 do
begin
close;
SQL.Clear;
SQL.Add('select * from admins where 學號='''+edt1.text+''' and 密碼='''+edt2.text+'''');
Open;
if Eof then
begin
ShowMessage('賬號或密碼錯誤');
exit;
end
else
begin //界面跳轉
Form2.Hide; //當前窗口隱藏
Form1.Show; //要跳轉到的窗口顯示
Form1.stat1.Panels[1].Text := edt1.Text;
Form1.stat1.Panels[3].Text := FieldValues['權限'];
Form1.stat1.Panels[5].Text := getTimeNow();
end;
end;
end;
end;
這樣一個登陸界面登陸及跳轉就實現了
出處 http://7071976.blog.51cto.com/7061976/1220038