idftpserver是indy9才提供的。
那位知道相关的信息,我将非常的感谢。
解决方案 »
- 怎么在excel画饼图呢?
- 请问DELPHI里有没有选择覆盖(override)父类方法的功能
- 求mxArrays 单元, dcu或pas都行
- 小弟有一个小的问题,那就是在一个文件流中有一串十六进制数2020,0000,我想读出时把2020分开,分成20与20,如何做.我的小例子如下.
- 如何读数?
- 在DELPHI里,如何调用另一个控件的事件代码,如:EDIT的鼠标单击事件?
- 关于如何改变Tcombbox的height的问题
- delphi做网页
- 基础知识菜鸟请教!!!???
- 大家赶紧帮我一把,怎么写一个模拟NT的 net send 命令的程序吧!我实在是没办法了!
- 请教!!!高手
- 串口异步通信问题
郁闷呀!
我有一个Demo
支持SSL的FTP服务器,不过只是支持虚拟的文件,要成为真实的文件只有处理一下事件就可以了
unit SSLFTPServer_Unit;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CRC32Verify, IdServerIOHandler, IdSSLOpenSSL,
IdBaseComponent, IdComponent, IdTCPServer, IdFTPServer, IdFTPList;type
TForm1 = class(TForm)
FTPSServer: TIdFTPServer;
ServerIOHandlerSSL: TIdServerIOHandlerSSL;
Label1: TLabel;
portLabel: TLabel;
Label2: TLabel;
procedure ServerIOHandlerSSLGetPassword(var Password: String);
procedure FormCreate(Sender: TObject);
procedure FTPSServerListDirectory(ASender: TIdFTPServerThread;
const APath: String; ADirectoryListing: TIdFTPListItems);
procedure FTPSServerCmd_PROTCommand(ASender: TIdCommand);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.ServerIOHandlerSSLGetPassword(var Password: String);
begin
Password:='aaaa';
end;procedure TForm1.FormCreate(Sender: TObject);
begin
portlabel.Caption:=InttoStr(FTPSServer.DefaultPort);
end;procedure TForm1.FTPSServerListDirectory(ASender: TIdFTPServerThread;
const APath: String; ADirectoryListing: TIdFTPListItems);
begin
With ADirectoryListing.Add do
begin
FileName:='SSL FTP Test Virtual Folder';
ItemType:=ditDirectory;
Size:=0;
ModifiedDate:=Now;
GroupName:='LY';
OwnerName:='LY';
UserPermissions:='r--';
GroupPermissions:='r--';
OwnerPermissions:='r--';
end;
With ADirectoryListing.Add do
begin
FileName:='SSL FTP Test Virtual File';
ItemType:=ditFile;
Size:=0;
ModifiedDate:=Now;
GroupName:='LY';
OwnerName:='LY';
UserPermissions:='r--';
GroupPermissions:='r--';
OwnerPermissions:='r--';
end;
end;procedure TForm1.FTPSServerCmd_PROTCommand(ASender: TIdCommand);
begin
if ASender.Params.Count<>1 then
begin
ASender.Reply.Text.Text:='parameter required';
ASender.Reply.NumericCode:=500;
Exit;
end;
if CompareText(ASender.Params[0], 'C')=0
then ASender.Reply.Text.Text:='PROT command OK. Using Clear data connection.'
else begin
ASender.Reply.Text.Text:='parameter not support by PROT command.';
ASender.Reply.NumericCode:=500;
end;
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if FTPSServer.Active then
try FTPSServer.Active:=false; except end;
end;end./ by LY http://lysoft.7u7.net http://liuyang.7i24.com http://lysoft.91i.net
有空去看看