以下是IW的unit ServerController;单元文件:
--------------
unit ServerController;
{PUBDIST}
interface
uses
Classes, DatamoduleUnit, IWServerControllerBase, IWAppForm, IWApplication,
SysUtils;
type
TIWServerController = class(TIWServerControllerBase)
procedure IWServerControllerBaseNewSession(ASession: TIWApplication;
var VMainForm: TIWAppForm);
private
public
end;
TUserSession = class(TComponent)
public
UserID:Integer;
UserName:String;
DataModule1: TDataModule1;
constructor Create(AOwner: TComponent); override;
end;
function UserSession: TUserSession;
implementation
{$R *.dfm}
uses
IWInit;
function UserSession: TUserSession;
begin
Result := TUserSession(RWebApplication.Data);
end;
{ TUserSession }
constructor TUserSession.Create(AOwner: TComponent);
begin
inherited;
Datamodule1 := TDatamodule1.Create(AOwner);
end;
procedure TIWServerController.IWServerControllerBaseNewSession(
ASession: TIWApplication; var VMainForm: TIWAppForm);
begin
ASession.Data := TUserSession.Create(ASession);
end;
end.
---------------------------------
看到UserSession 了吗 ??