Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Unit2.pas
Package: xiaobai.rar [view]
Upload User: autowell
Upload Date: 2022-06-21
Package Size: 16754k
Code Size: 2k
Category:
Delphi VCL
Development Platform:
Delphi
- unit Unit2;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, DB, ADODB, Mask;
- type
- TForm2 = class(TForm)
- Label1: TLabel;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- Button1: TButton;
- ADOQuery1: TADOQuery;
- GroupBox1: TGroupBox;
- Label2: TLabel;
- Edit3: TEdit;
- Label5: TLabel;
- DataSource1: TDataSource;
- DataSource2: TDataSource;
- ADOQuery2: TADOQuery;
- MaskEdit1: TMaskEdit;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form2: TForm2;
- implementation
- uses Unit3;
- {$R *.dfm}
- procedure TForm2.Button1Click(Sender: TObject);
- var
- ad_name,ad_psd:string;
- sno:string;
- begin
- if not(radiobutton1.Checked) and not(radiobutton2.Checked) then
- application.MessageBox('请选择登陆身份','确定',mb_ok);
- if radiobutton1.Checked then
- begin
- if edit3.Text='' then application.MessageBox('请选择正确用户名登陆','确定',mb_ok);
- adoquery1.Active:=true;
- ad_name:=adoquery1.Fields[0].Value;
- ad_psd:=adoquery1.Fields[1].Value;
- if(edit3.Text=ad_name) and (maskedit1.Text=ad_psd) then
- begin
- application.MessageBox('你已经成功登陆','确定',mb_ok);
- form3.show;
- end
- else
- application.MessageBox('用户名或密码','确定',mb_ok);
- end;
- if radiobutton2.Checked then
- begin
- if edit3.Text='' then application.MessageBox('请选择正确用户名登陆','确定',mb_ok);
- with adoquery2 do
- begin
- close;
- sql.Clear;
- sql.Add('select * from student');
- sql.Add('where');
- sql.Add('sno='+ quotedstr(edit3.Text));
- open;
- active:=true;
- end;
- if adoquery2.Recordcount=0 then
- application.MessageBox('用户名不存在','确定',mb_ok)
- else
- begin
- sno:=adoquery2.Fields[0].Value;
- if(edit3.Text=sno) and (maskedit1.Text=sno) then
- begin
- application.MessageBox('成功登陆','确定',mb_ok);
- form3.Show;
- form2.edit3.Text:='';
- form2.maskedit1.Text:='';
- end
- else
- application.MessageBox('密码有误','确定',mb_ok);
- end;
- end;
- end;
- end.