程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Delphi >> DELPHI DATASNAP 2010入門操作(2)不寫一行代碼,綠色三層我也行(4)

DELPHI DATASNAP 2010入門操作(2)不寫一行代碼,綠色三層我也行(4)

編輯:Delphi

我們再看看生成的單元內容是什麼

unit ServerMethodsUnit1;

1 unit ServerMethodsUnit1;
  2
  3  interface
  4
  5  uses
  6  SysUtils, Classes, DSServer;
  7
  8  type
  9  TServerMethods1 = class(TDSServerModule)
10  private
11   { Private declarations }
12  public
13   { Public declarations }
14   function EchoString(Value: string): string;
15  end;
16
17  implementation
18
19  {$R *.dfm}
20
21  function TServerMethods1.EchoString(Value: string): string;
22  begin
23  Result := Value;
24  end;
25
26  end.

unit ServerContainerUnit1;

1 unit ServerContainerUnit1;
  2
  3  interface
  4
  5  uses
  6  SysUtils, Classes, 
  7  DSTCPServerTransport,
  8  DSServer, DSCommonServer;
  9
10  type
11  TServerContainer1 = class(TDataModule)
12   DSServer1: TDSServer;
13   DSTCPServerTransport1: TDSTCPServerTransport;
14   DSServerClass1: TDSServerClass;
15   procedure DSServerClass1GetClass(DSServerClass:  TDSServerClass;
16    var PersistentClass: TPersistentClass);
17  private
18   { Private declarations }
19  public
20  end;
21
22  var
23  ServerContainer1: TServerContainer1;
24
25  implementation
26
27  uses Windows, ServerMethodsUnit1;
28
29 {$R *.dfm}
30
31 procedure TServerContainer1.DSServerClass1GetClass(
32  DSServerClass: TDSServerClass; var PersistentClass:  TPersistentClass);
33 begin
34  PersistentClass := ServerMethodsUnit1.TServerMethods1;
35 end;
36
37 end.

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved