main.pas

来自「这是一套全面的网络组件」· PAS 代码 · 共 77 行

PAS
77
字号
unit main;

{
This demo implements a fully functional multi-session FTP server
which is implemented as the Windows NT service.

Please use the steps below to run this sample:
1. Install the SvCom library (by http://www.aldyn.ru)
2. Open and compile the SvComFtpServer.dpr project.
3. Install the "Clever Internet Suite FTP service" service using the following command line:

   SvComFtpServer.exe /install

After that, the "Clever Internet Suite FTP service" can be run using
the standard Services window.

Please use the "CleverTester" user name and "clevertester" password to log-in.
Also the anonymous user is supported.

You can uninstall the "Clever Internet Suite FTP service" service
using the following command line:

   SvComFtpServer.exe /uninstall

Please see the SvCom library documentation for more details.
}

interface

uses
    Windows,
    Messages,
    SysUtils,
    Classes,
    Graphics,
    Dialogs,
    Controls,
    SvCom_NTService, clTcpServer, clFtpServer, clFtpFileHandler, clUtils;

type
  TCleverFtpService = class(TNtService)
    clFtpServer1: TclFtpServer;
    clFtpFileHandler1: TclFtpFileHandler;
    procedure NtServiceStart(Sender: TNtService; var DoAction: Boolean);
    procedure NtServiceStop(Sender: TNtService; var DoAction: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  CleverFtpService: TCleverFtpService;

implementation

{$R *.DFM}


procedure TCleverFtpService.NtServiceStart(Sender: TNtService;
  var DoAction: Boolean);
begin
  ForceFileDirectories(clFtpServer1.RootDir);
  clFtpServer1.Start();
end;

procedure TCleverFtpService.NtServiceStop(Sender: TNtService;
  var DoAction: Boolean);
begin
  clFtpServer1.Stop();
end;

end.

 
 

⌨️ 快捷键说明

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