⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_newuser.pas

📁 Delphi 应用举例
💻 PAS
字号:
unit U_newuser;
{PUBDIST}

interface

uses
  IWAppForm, IWApplication, IWTypes, IWCompButton, IWCompLabel, Classes,
  Controls, IWControl, IWCompEdit, u_frame3, Forms, U_frame_head;

type
  TformMainNewUser = class(TIWAppForm)
    IWEditID: TIWEdit;
    IWEditPWD: TIWEdit;
    IWEditMail: TIWEdit;
    IWLabel1: TIWLabel;
    IWLabel2: TIWLabel;
    IWLabel3: TIWLabel;
    IWButton1: TIWButton;
    IWButton2: TIWButton;
    IWEditPWD1: TIWEdit;
    Frame11: TFrame1;
    Frame31: TFrame3;
    procedure IWButton1Click(Sender: TObject);
    procedure IWButton2Click(Sender: TObject);
    procedure IWAppFormCreate(Sender: TObject);
  public
  end;

implementation
{$R *.dfm}

uses
  ServerController,IWUnit1,SysUtils;

procedure TformMainNewUser.IWButton1Click(Sender: TObject);
var buf:TUserInfo;
begin
  if IWEditID.Text='' then begin
     webapplication.ShowMessage('"UserID"不能空!');
     exit;
  end;
  if IWEditPWD.Text='' then begin
     webapplication.ShowMessage('"Password"不能空!');
     exit;
  end;
  if IWEditPWD.Text<>IWEditPWD1.Text then begin
     webapplication.ShowMessage('两次口令不一样!');
     exit;
  end;
  buf:=userlist.find(IWEditID.Text);
  if buf.userID<>'' then begin
     webapplication.ShowMessage('对不起!这个ID已被使用。');
     exit;
  end;
  
  buf.userID:=IWEditID.Text;
  buf.pwd:=IWEditPWD.Text;
  buf.mail:=IWEditMail.Text;
  buf.kind:=2;

  userlist.add(buf);

  usersession.userID:=IWEditID.Text;
  free;
  TformMain.create(webapplication).show;
end;

procedure TformMainNewUser.IWButton2Click(Sender: TObject);
begin
    Webapplication.Terminate('Bye-bye!');
end;

procedure TformMainNewUser.IWAppFormCreate(Sender: TObject);
begin
    Frame31.lbluser.Caption:='当前用户:'+Usersession.userID;
    Frame31.lblCount.Caption:='在线用户数:'+IntToStr(UserOnLine-1);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -