版本10 seattle

新建intraWeb

new->other->Delphi Projecs->IntraWeb->IntraWeb Application wizard

建立测试工程时, 一般要使用 StandAlone Application, 这方便调试; 具体发布时只需稍稍修改.

自动生成,以下几个文件

Project1

program Project1;

uses
Vcl.Forms,  ---这里本来是生成是Forms,     //报错,看了万一的博客说了这句“   还是以前的那个 Forms, 现在叫 Vcl.Forms 了 ”,改了不报错

IWStart,
UTF8ContentParser,
Unit1 in 'Unit1.pas' {IWForm1: TIWAppForm},
ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase},  //这才是 IntraWeb 工程的核心单元, 每个工程都会在该单元自动建立一个(只有一个)                                           Server Controller 对象, 这个对象统管所有(包括 Session)

UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase};   //该单元主要维护一个 Session 数据对象, 并提供给 ServerController 使用

{$R *.res}

begin
TIWStart.Execute(True);
end.

//这里的代码是自动维护的; 只有在修改发布模式时, 才会来这里做简单的修改(譬如把 program Project1 改为 library Project1 

UserSessionUnit;

unit UserSessionUnit;

{
This is a DataModule where you can add components or declare fields that are specific to
ONE user. Instead of creating global variables, it is better to use this datamodule. You can then
access the it using UserSession.
}

{注释}
//该单元目前只有一个空的 TIWUserSession, 但也已被 ServerController 单元 uses 并使用
//不同的网站程序对用户信息的需求可能不一样(譬如: 登陆信息、购物车信息等等), 我们可以在这里定义需要的数据格式; 因为灵活性很大, 所以关于 Session 的方便操作也是 IW 在宣传时首先要吹嘘的
//在它的窗体上可以放置非可视控件
//TIWUserSessionBase 的父类是我们熟悉的 TDataModule, 所以我说这是 Session 相关的数据模块.

interface

uses
IWUserSessionBase, SysUtils, Classes;

type
TIWUserSession = class(TIWUserSessionBase)
private
{ Private declarations }
public
{ Public declarations }
end;

implementation

{$R *.dfm}

end.

ServerController;

unit ServerController;

interface

uses
SysUtils, Classes, IWServerControllerBase, IWBaseForm, HTTPApp,
// For OnNewSession Event
UserSessionUnit, IWApplication, IWAppForm;

type
TIWServerController = class(TIWServerControllerBase)
procedure IWServerControllerBaseNewSession(ASession: TIWApplication);

private

public
end;

function UserSession: TIWUserSession;
function IWServerController: TIWServerController;

implementation

{$R *.dfm}

uses
IWInit, IWGlobal;

function IWServerController: TIWServerController;
begin
Result := TIWServerController(GServerController);
end;

function UserSession: TIWUserSession;
begin
Result := TIWUserSession(WebApplication.Data);
end;

procedure TIWServerController.IWServerControllerBaseNewSession(
ASession: TIWApplication);
begin
ASession.Data := TIWUserSession.Create(nil);
end;

initialization
TIWServerController.SetServerControllerClass;

end.

delphi xe---intraweb基本介绍的更多相关文章

  1. Delphi XE中使用dbExpress连接MySQL数据库疑难问题解决(对三层的例子配置有帮助)

    Delphi IDE中包含一个Data Explorer的组件,如下图所示: 该组件基于dbExpress(包含TSQLConnection.TSQLDataSet.TSQLQuery.TSQLSto ...

  2. Delphi XE中使用dbExpress连接MySQL数据库疑难问题解决

    Delphi IDE中包含一个Data Explorer的组件,如下图所示: 该组件基于dbExpress(包含TSQLConnection.TSQLDataSet.TSQLQuery.TSQLSto ...

  3. delphi 2010与delphi XE破解版的冲突

    在系统中同时安装了Dephi 2010LITE版与Delphi XE lite后,总是会有一个有问题 是因为两者都是读取C:\ProgramData\Embarcadero目录下的license文件, ...

  4. [转载]: delphi中XLSReadWrite控件的使用(2)---delphi XE下安装

    一.下载 官方下载网址: http://www.axolot.com/components/download.htm 从这里可以下载到从Delphi5到DelphiXE全部支持的版本. 二.软件安装 ...

  5. delphi XE Berlin ReadProcessMemory WriteProcessMemory

    delphi  XE,Berlin [dcc32 Error] Unit9.pas(93): E2033 Types of actual and formal var parameters must ...

  6. FastReport for delphi xe 安装步骤

    FastReport for delphi xe 安装步骤 1.先关闭DELPHI:2.下载后解压到一个目录,比如:D:FR:3.打开D:FR,运行recompile.exe ->点击" ...

  7. Delphi XE的firemonkey获取当前文件所在路径的方法

    Delphi XE的firemonkey获取当前文件所在路径的方法 在之前,我们知道有三种方法: ExtractFilePath(ParamStr(0)) ExtractFilePath(Applic ...

  8. Delphi xe 下快捷使用 FastMM 的内存泄露检测功能

    Delphi xe 集成了FastMM,调试程序是的时候可以方便地检查内存泄露了.  使用方法:在project中,添加一行: ReportMemoryLeaksOnShutdown := Debug ...

  9. Delphi XE中类成员的访问权限(新增了strict private和strict protected,还有automated)

    Delphi XE中类成员的访问权限共提供了6个关键词来用于限定访问权限:public.private.protected.published.automated strict private . s ...

  10. [转]:Delphi XE中泛型数组的使用范例

    Delphi XE中泛型数组的使用范例,下面的范例简单的使用了泛型字符串数组,如用 TArray 代替 array of Word, 还可以使用 TArray 类提供的算法(就是少了点). uses ...

随机推荐

  1. 本体论与OWL

    http://semanticweb.org/wiki/Main_Page.html http://owl.man.ac.uk/documentation.shtml  https://zh.wiki ...

  2. struts和spring整合

    开发流程: 1)引jar包,可以在配置工程中设置用户libarary,然后直接引入.如果在web-inf/lib没有用户导入的lib文件,可以参考问题0的解决方案 需要的是struts_core,sp ...

  3. 捅伊朗黑客PP — 后台登陆POST+错误回显 注入

    看了一个泰国政府的网站被伊朗的黑客挂页,上面写着“Your Box 0wn3z By Behrooz_Ice – Q7x -Sha2ow -Virangar -Ali_Eagle -iman_takt ...

  4. 从12306网站新验证码看Web验证码设计与破解

    2015年3月16日,铁路官方购票网站12306又出新招,在登录界面推出了全新的验证方式,用户在填写好登录名和密码之后,还要准确的选取图片验证码才能登陆成功.据悉,12306验证码改版后,目前所有抢票 ...

  5. php-fpm配置详解

    php-fpm详解 原文链接:http://php-fpm.anight.org/wiki:http://www.php-fpm.com/翻译:http://syre.blogbus.com/logs ...

  6. Source Insight 项目简单使用说明

    SI(Source Insight) 是我一直写代码的好伙伴, 相信这强大的软件也是广大程序猿编写软件的利器. 正所谓" 工欲善其事, 必先利其器", 我们要学会利用这款软件. 先 ...

  7. html-文本处理集-持续学习更新

    文件处理2:分区分块.有序无序 <!-- 申明HTML5版本 --> <!DOCTYPE html> <html lang="en"> < ...

  8. DOCTYPE 与浏览器模式分析

    DOCTYPE 的诞生 DOCTYPE,或者称为 Document Type Declaration(文档类型声明,缩写 DTD).通常情况下,DOCTYPE 位于一个 HTML 文档的最前面的位置, ...

  9. 当一个线程进入一个对象的synchronized方法A之后,其他线程是否可进入此对象的synchronized方法B?

    给出答案: 是不能的,其他线程只能访问该对象的非同步方法,同步方法则不能进入; 因为非静态方法上的synchronized修饰符要求执行方法时要获得对象的锁,如果已经进入A方法,说明对象锁已经被取

  10. LCD屏参数及应用举例

     1.  LCD参数及原理 R G B 信号 PCLK(像素时钟),LCLK(HSYNC,线时钟,水平同步时钟),FCLK(VSYNC,帧时钟,垂直同步时钟) 7寸屏一般由两种工作模式DE和时钟模式, ...