?? amdelphi.pas
字號:
unit AMDelphi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleServer, APIPECOMLib_TLB, Mask;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
MaskEdit1: TMaskEdit;
GroupBox1: TGroupBox;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
procedure Button1Click(Sender: TObject);
procedure CancleAM(Sender: TObject);
procedure ColseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
LoginName : string
end;
var
Form1: TForm1;
implementation
uses AMMain;
{$R *.dfm}
//----------------
//用戶登錄
//----------------
procedure TForm1.Button1Click(Sender: TObject);
var
LoginInfo : TAMLoginInfo;
Aowner : TComponent;
lResult : Integer ;
begin
//-----------------------
//創(chuàng)建一個對象
//-----------------------
LoginInfo := TAMLoginInfo.Create(Aowner);
LoginInfo.LoginName := Edit1.Text ;
//-----------------------
//保存當(dāng)前登錄用戶信息
//-----------------------
LoginName:= Edit1.Text;
LoginInfo.ServerPort := 5001;
LoginInfo.Server := ComboBox1.Text ;
LoginInfo.Password := MaskEdit1.Text ;
form2.AMSession1.ConnectTo(form2.AMConsol1.NewSession() );
form2.AMSession1.AddMsgMap('SYSMSG','',0,'',0);
form2.amsession1.AddMsgMap('MSG','GEN',0,'',0);
lResult := form2.AMSession1.SignIn(LoginInfo.DefaultInterface, nil);
form1.Close ;
end;
procedure TForm1.CancleAM(Sender: TObject);
begin
if(form1 is TObject) then
form1.Close;
if(form2 is TObject) then
form2.Close;
end;
procedure TForm1.ColseQuery(Sender: TObject; var CanClose: Boolean);
begin
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -