亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ftpsrvc.pas

?? 包含常用Internet協議TCP,UDP、HTTP、FTP、Telnet等
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*_* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Author:       Fran鏾is PIETTE
Description:  TFtpCtrlSocket component. It handle the client connection for
              the TFtpServer component.
Creation:     April 21, 1998
Version:      1.06
EMail:        http://users.swing.be/francois.piette  francois.piette@swing.be
              http://www.rtfm.be/fpiette             francois.piette@rtfm.be
              francois.piette@pophost.eunet.be
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1997-2000 by Fran鏾is PIETTE
              Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56
              <francois.piette@pophost.eunet.be>

              This software is provided 'as-is', without any express or
              implied warranty.  In no event will the author be held liable
              for any  damages arising from the use of this software.

              Permission is granted to anyone to use this software for any
              purpose, including commercial applications, and to alter it
              and redistribute it freely, subject to the following
              restrictions:

              1. The origin of this software must not be misrepresented,
                 you must not claim that you wrote the original software.
                 If you use this software in a product, an acknowledgment
                 in the product documentation would be appreciated but is
                 not required.

              2. Altered source versions must be plainly marked as such, and
                 must not be misrepresented as being the original software.

              3. This notice may not be removed or altered from any source
                 distribution.

              4. You must register this software by sending a picture postcard
                 to the author. Use a nice stamp and mention your name, street
                 address, EMail address and any comment you like to say.

History:
Apr 29, 1998  V0.90 released for beta testing.
May 03, 1998  V0.93 Adapted for Delphi 2.0 and C++Builder
May 04, 1998  V0.94 Added support for UNC (not finished !)
Jul 09, 1998  V1.00 Adapted for Delphi 4, removed beta status.
Jul 21, 1998  V1.01 Publised TrumpetCompatibility property.
Aug 06, 1998  V1.02 Verified that FRcvCnt was 0 in SetRcvSize. Suggested
              by Nick MacDonald <NickMacDonald@hotmail.com>
Mar 06, 1999  V1.03 Added code from  Plegge, Steve <jsp@nciinc.com> to add
              APPE and STRU support.
Aug 20, 1999  V1.04 Revised compile time options. Adapted for BCB4.
Nov 24, 1999  V1.05 Added MTDM support. Thanks to Bruce Christensen
              <bkc51831234@hotmail.com> for his code.
Jan 24, 2000  V1.06 Patch IE5 bug in file names. Thanks to <dsnake@infonie.fr>

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit FtpSrvC;

interface

{$B-}           { Enable partial boolean evaluation   }
{$T-}           { Untyped pointers                    }
{$X+}           { Enable extended syntax              }
{$IFNDEF VER80} { Not for Delphi 1                    }
    {$H+}       { Use long strings                    }
    {$J+}       { Allow typed constant to be modified }
{$ENDIF}
{$IFDEF VER110} { C++ Builder V3.0                    }
    {$ObjExportAll On}
{$ENDIF}
{$IFDEF VER125} { C++ Builder V4.0                    }
    {$ObjExportAll On}
{$ENDIF}

uses
    WinTypes, WinProcs, Messages, Classes, SysUtils, Winsock, WSocket;

const
    FtpCtrlSocketVersion = 106;
    CopyRight : String = ' TFtpCtrlSocket  (c) 1998-2000 F. Piette V1.06 ';
    DefaultRcvSize       = 2048;

type
    EFtpCtrlSocketException = class(Exception);
    TFtpCtrlState = (ftpcInvalid, ftpcWaitingUserCode, ftpcWaitingPassword,
                     ftpcReady, ftpcWaitingAnswer);
    TFtpCmdType   = (ftpcPORT, ftpcSTOR, ftpcRETR, ftpcCWD,  ftpcXPWD, ftpcPWD,
                     ftpcUSER, ftpcPASS, ftpcLIST, ftpcRMD,  ftpcTYPE, ftpcSYST,
                     ftpcQUIT, ftpcDELE, ftpcRNFR, ftpcMKD,  ftpcRNTO, ftpcNOOP,
                     ftpcNLST, ftpcABOR, ftpcCDUP, ftpcSIZE, ftpcREST, ftpcAPPE,
                     ftpcSTRU,   {jsp - Added APPE and STRU types}
                     ftpcMDTM);  {bkc - Added MDTM type }
    TFtpOption    = (ftpcUNC);
    TFtpOptions   = set of TFtpOption;
    TDisplayEvent = procedure (Sender : TObject; Msg : String) of object;
    TCommandEvent = procedure (Sender : TObject; CmdBuf : PChar; CmdLen : Integer) of object;

    TFtpCtrlSocket = class(TCustomWSocket)
    protected
        FDataSocket        : TWSocket;
        FRcvBuf            : PChar;
        FRcvCnt            : Integer;
        FRcvSize           : Integer;
        FBusy              : Boolean;
        FConnectedSince    : TDateTime;
        FLastCommand       : TDateTime;
        FCommandCount      : LongInt;
        FBanner            : String;
        FUserName          : String;
        FPassWord          : String;
        FCloseRequest      : Boolean;
        FHomeDir           : String;
        FDirectory         : String;
        FFtpState          : TFtpCtrlState;
        FAbortingTransfer  : Boolean;
        FUserData          : LongInt;        { Reserved for component user }
        FPeerAddr          : String;
        FOnDisplay         : TDisplayEvent;
        FOnCommand         : TCommandEvent;
        procedure TriggerSessionConnected(Error : Word); override;
        function  TriggerDataAvailable(Error : Word) : boolean; override;
        procedure TriggerCommand(CmdBuf : PChar; CmdLen : Integer); virtual;
        procedure SetRcvSize(newValue : Integer);
    public
        BinaryMode        : Boolean;
        DataAddr          : String;
        DataPort          : String;
        FileName          : String;
        FilePath          : String;
        DataSessionActive : Boolean;
        DataStream        : TStream;
        HasOpenedFile     : Boolean;
        TransferError     : String;
        ByteCount         : LongInt;
        DataSent          : Boolean;
        CurCmdType        : TFtpCmdType;
        RestartPos        : LongInt;
        FromFileName      : String;
        ToFileName        : String;
        PassiveMode       : Boolean;
        PassiveStart      : Boolean;
        PassiveConnected  : Boolean;
        Options           : TFtpOptions;
        constructor Create(AOwner: TComponent); override;
        destructor  Destroy; override;
        procedure   Dup(newHSocket : TSocket); override;
        procedure   StartConnection; virtual;
        procedure   SendAnswer(Answer : String);
        procedure   SetDirectory(newValue : String);
        procedure   SetAbortingTransfer(newValue : Boolean);
        function    GetPeerAddr: string; override;
        property    DataSocket     : TWSocket    read FDataSocket;
        property    ConnectedSince : TDateTime   read FConnectedSince;
        property    LastCommand    : TDateTime   read FLastCommand;
        property    CommandCount   : LongInt     read FCommandCount;
        property    RcvBuf         : PChar       read FRcvBuf;
        property    RcvdCount;
        property    CloseRequest   : Boolean     read  FCloseRequest
                                                 write FCloseRequest;
        property Directory : String              read  FDirectory
                                                 write SetDirectory;
        property HomeDir : String                read  FHomeDir
                                                 write FHomeDir;
        property AbortingTransfer : Boolean      read  FAbortingTransfer
                                                 write SetAbortingTransfer;
    published
        property FtpState : TFtpCtrlState  read  FFtpState
                                           write FFtpState;
        property Banner : String           read  FBanner
                                           write FBanner;
        property RcvSize : integer         read  FRcvSize
                                           write SetRcvSize;
        property Busy : Boolean            read  FBusy
                                           write FBusy;
        property UserName : String         read  FUserName
                                           write FUserName;
        property PassWord : String         read  FPassWord
                                           write FPassWord;
        property UserData  : LongInt       read  FUserData
                                           write FUserData;
        property OnDisplay : TDisplayEvent read  FOnDisplay
                                           write FOnDisplay;
        property OnCommand : TCommandEvent read  FOnCommand
                                           write FOnCommand;
        property OnSessionClosed;
        property OnDataSent;
        property HSocket;
        property AllSent;
        property State;
{$IFDEF VER80}
        property TrumpetCompability;
{$ENDIF}
    end;

function  IsUNC(S : String) : Boolean;
procedure PatchIE5(var S : String);
{$IFDEF VER80}
function ExtractFileDir(const FileName: String): String;
function ExtractFileDrive(const FileName: String): String;
{$ENDIF}

implementation

const
    DefaultBanner = '220-ICS FTP Server ready';


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{$IFDEF VER80}
procedure SetLength(var S: string; NewLength: Integer);
begin
    S[0] := chr(NewLength);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ ExtractFileDir extracts the drive and directory parts of the given        }
{ filename. The resulting string is a directory name suitable for passing   }
{ to SetCurrentDir, CreateDir, etc. The resulting string is empty if        }
{ FileName contains no drive and directory parts.                           }
function ExtractFileDir(const FileName: String): String;
var
    I: Integer;
begin
    I := Length(FileName);
    while (I > 0) and (not (FileName[I] in ['\', ':'])) do
        Dec(I);
    if (I > 1) and (FileName[I] = '\') and
       (not (FileName[I - 1] in ['\', ':'])) then
        Dec(I);
    Result := Copy(FileName, 1, I);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ ExtractFileDrive extracts the drive part of the given filename.  For        }
{ filenames with drive letters, the resulting string is '<drive>:'.           }
{ For filenames with a UNC path, the resulting string is in the form          }
{ '\\<servername>\<sharename>'.  If the given path contains neither           }
{ style of filename, the result is an empty string.                           }
function ExtractFileDrive(const FileName: String): String;
var
    I : Integer;
begin
    if Length(FileName) <= 1 then
        Result := ''
    else begin
        if FileName[2] = ':' then
            Result := Copy(FileName, 1, 2)
        else if (FileName[2] = '\') and (FileName[1] = '\') then begin
            { UNC file name }
            I := 3;
            while (I <= Length(FileName)) and (FileName[I] <> '\') do
                Inc(I);
            Inc(I);
            while (I <= Length(FileName)) and (FileName[I] <> '\') do
                Inc(I);
            Result := Copy(FileName, 1, I - 1);
        end
        else
            Result := '';
    end;
end;
{$ENDIF}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品一二三| 激情综合五月婷婷| 综合久久久久久| 日本一区二区视频在线| 欧美精品一区二区高清在线观看 | 欧美日韩久久不卡| 欧美亚洲国产一卡| 欧美日本国产一区| 欧美精品亚洲二区| 精品久久国产字幕高潮| 久久久久久免费| 国产精品久久久久久一区二区三区 | 国产一区二区三区免费播放| 激情欧美一区二区三区在线观看| 国内精品伊人久久久久av影院| 国产精品中文字幕日韩精品| 成人18视频在线播放| 色88888久久久久久影院按摩| 欧美群妇大交群中文字幕| 日韩视频免费观看高清完整版在线观看 | 日本三级韩国三级欧美三级| 狠狠色丁香久久婷婷综合丁香| 懂色av一区二区三区免费观看| 一本色道久久加勒比精品| 制服丝袜亚洲网站| 亚洲国产经典视频| 五月天激情综合网| 成人免费视频app| 欧美日韩中文字幕一区二区| 欧美videossexotv100| 国产欧美日韩另类一区| 亚洲成年人影院| 懂色av中文一区二区三区 | 首页综合国产亚洲丝袜| 国产一区二区不卡在线| 欧美在线观看一区| 久久久影视传媒| 日韩专区一卡二卡| 成人精品鲁一区一区二区| 欧美日韩中文精品| 国产精品美女久久久久av爽李琼| 石原莉奈在线亚洲三区| 成人h动漫精品一区二区| 日韩欧美成人一区二区| 亚洲激情图片小说视频| 国产一区二区视频在线| 欧美卡1卡2卡| 亚洲视频每日更新| 国产成人综合精品三级| 91国产丝袜在线播放| 欧美国产一区二区| 美女在线视频一区| 欧美日韩免费视频| 亚洲精品乱码久久久久久久久| 国产一区二区主播在线| 6080yy午夜一二三区久久| 17c精品麻豆一区二区免费| 九色porny丨国产精品| 欧美日韩高清一区二区不卡| 亚洲免费伊人电影| 成人福利视频在线看| 2021国产精品久久精品| 久久国产精品99久久人人澡| 欧美日本韩国一区二区三区视频| 一区二区激情视频| 99国产精品久久久久| 国产精品久久毛片a| 国内成人自拍视频| 精品久久一区二区三区| 午夜免费欧美电影| 在线一区二区视频| 一区二区三区**美女毛片| 一本高清dvd不卡在线观看 | 在线视频国产一区| 亚洲激情图片qvod| 在线观看国产91| 亚洲一区二区黄色| 欧美日韩大陆在线| 日韩精品五月天| 欧美一级黄色大片| 九九国产精品视频| 久久久激情视频| 91麻豆国产福利精品| 亚洲午夜三级在线| 日韩亚洲欧美一区二区三区| 久久精品av麻豆的观看方式| 欧美成人艳星乳罩| 国产大陆亚洲精品国产| 亚洲欧洲国产专区| 欧美日韩久久一区二区| 青青草精品视频| 国产免费久久精品| 色综合激情五月| 日本在线不卡视频| 国产亚洲欧美日韩日本| 色综合欧美在线| 免费成人在线播放| 国产亚洲精品超碰| 91精品1区2区| 精品亚洲成av人在线观看| 亚洲欧洲三级电影| 欧洲精品在线观看| 激情欧美一区二区三区在线观看| 日韩毛片在线免费观看| 欧美一区二区三区日韩视频| 国产精品一区免费视频| 亚洲精品成a人| 精品国产一区二区三区久久久蜜月| 国产电影一区在线| 亚洲6080在线| 中文av一区二区| 欧美伦理电影网| 粉嫩高潮美女一区二区三区| 天天综合天天综合色| 久久精品无码一区二区三区| 色菇凉天天综合网| 国产一区在线不卡| 午夜一区二区三区视频| 久久综合久久综合九色| 91福利视频久久久久| 国产传媒久久文化传媒| 日韩国产在线观看一区| 国产精品素人一区二区| 欧美va亚洲va香蕉在线| 日本韩国精品一区二区在线观看| 久久99最新地址| 亚洲大片精品永久免费| 亚洲免费观看在线观看| 中文字幕第一区| 欧美成人女星排行榜| 在线91免费看| 在线观看区一区二| 91在线观看免费视频| 国产一区在线观看视频| 蜜桃免费网站一区二区三区| 丝袜亚洲另类欧美综合| 亚洲乱码中文字幕| 国产精品久久综合| 久久久精品人体av艺术| 日韩亚洲欧美综合| 欧美一级午夜免费电影| 欧美高清视频不卡网| 欧美日韩精品欧美日韩精品一 | 国产精品美女久久福利网站| 久久精品一区二区三区不卡| 日韩免费高清av| 精品国产不卡一区二区三区| 欧美绝品在线观看成人午夜影视| 在线观看国产日韩| 欧美性大战久久久久久久蜜臀| 91网址在线看| 欧洲亚洲精品在线| 欧美日韩一级视频| 69av一区二区三区| 欧美大片一区二区| 精品国产百合女同互慰| 久久九九国产精品| 中文字幕在线不卡视频| 国产精品不卡在线| 亚洲精品老司机| 午夜欧美大尺度福利影院在线看| 亚洲国产精品人人做人人爽| 日本视频免费一区| 精品综合久久久久久8888| 国产一区二区三区黄视频| 国产精品一区不卡| 色综合视频在线观看| 欧美精品在线观看播放| 欧美成人r级一区二区三区| 久久伊人蜜桃av一区二区| 国产欧美一区二区在线| 国产精品天美传媒| 亚洲最新在线观看| 捆绑变态av一区二区三区| 国产精品一二三四区| 91农村精品一区二区在线| 欧美日免费三级在线| 欧美大片在线观看一区二区| 国产精品欧美一级免费| 亚洲午夜在线电影| 精品在线免费观看| aaa欧美色吧激情视频| 在线成人小视频| 国产日产欧产精品推荐色| 尤物在线观看一区| 久久99精品国产麻豆不卡| av不卡免费在线观看| 日韩精品一区二区三区三区免费| 国产女主播在线一区二区| 婷婷国产v国产偷v亚洲高清| 丁香另类激情小说| 欧美伦理影视网| 国产精品美女视频| 免费人成精品欧美精品 | 午夜影视日本亚洲欧洲精品| 国产很黄免费观看久久| 9191精品国产综合久久久久久 | 欧美不卡在线视频| 亚洲靠逼com| 国产精品69久久久久水密桃|