亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久国产综合精品| 亚洲少妇最新在线视频| 亚洲最大成人网4388xx| 99久久综合国产精品| 久久久天堂av| 国产suv一区二区三区88区| 国产精品热久久久久夜色精品三区 | 久久亚洲精品国产精品紫薇| 国产成人午夜99999| 亚洲另类中文字| 日韩欧美黄色影院| 成熟亚洲日本毛茸茸凸凹| 亚洲另类色综合网站| 亚洲欧洲中文日韩久久av乱码| 欧美日韩高清在线| 国产在线精品一区二区夜色| 宅男在线国产精品| 豆国产96在线|亚洲| 9人人澡人人爽人人精品| 粉嫩蜜臀av国产精品网站| 国产成a人亚洲精| 91视频在线看| 国产剧情在线观看一区二区| 一区二区免费在线播放| 亚洲永久免费av| 国产婷婷色一区二区三区在线| 欧美性大战久久久久久久| 国产真实乱偷精品视频免| 国产成人午夜电影网| 欧美亚洲一区三区| 欧美成人猛片aaaaaaa| 欧美丰满少妇xxxxx高潮对白 | 狠狠色综合色综合网络| 国产成人免费xxxxxxxx| 色一区在线观看| 国模大尺度一区二区三区| 不卡一卡二卡三乱码免费网站| 久久不见久久见免费视频1| 成人精品免费视频| 精品1区2区3区| 99re亚洲国产精品| 91在线精品一区二区| 欧美亚洲综合另类| 国产欧美一区二区在线| 国产女主播在线一区二区| 亚洲麻豆国产自偷在线| 久久精工是国产品牌吗| 91黄色免费版| 91国内精品野花午夜精品 | 成人app软件下载大全免费| 欧美日韩一卡二卡| 国产精品麻豆欧美日韩ww| 蜜桃一区二区三区在线观看| 日韩黄色片在线观看| 亚洲1区2区3区视频| 亚洲电影一级黄| 成人一级黄色片| 日韩精品综合一本久道在线视频| 伊人婷婷欧美激情| 成人精品免费视频| 久久久亚洲精华液精华液精华液| 亚洲.国产.中文慕字在线| 91一区在线观看| 久久久精品免费网站| 久久精品国产亚洲a| 欧洲一区二区av| 91精品国产综合久久国产大片| 3d动漫精品啪啪一区二区竹菊| 亚洲欧美综合色| 五月婷婷综合激情| 国产在线精品一区二区夜色 | 久久99精品久久只有精品| 精品一区二区在线看| 91精品国产一区二区| 婷婷成人综合网| 欧美日韩久久久| 亚洲一线二线三线久久久| 欧美在线一区二区| 一区二区三区欧美视频| 91免费版在线看| 最新国产精品久久精品| 99精品久久久久久| 亚洲精品免费看| 欧洲精品在线观看| 亚洲超碰97人人做人人爱| 678五月天丁香亚洲综合网| 日本午夜一区二区| 成人av动漫在线| 亚洲天堂a在线| 色婷婷亚洲精品| 天堂av在线一区| 日韩精品一区二区三区视频播放 | 国产精品白丝jk白祙喷水网站| 久久综合久久综合亚洲| 国产在线视频精品一区| 欧美国产一区二区在线观看| 亚洲图片欧美视频| 成人精品高清在线| 亚洲精品高清在线观看| 欧美日韩国产免费一区二区| 免费亚洲电影在线| 欧美视频一区二区三区在线观看| 亚洲一区二区三区四区在线 | 精品一区二区在线免费观看| 国产清纯白嫩初高生在线观看91| 91一区二区三区在线播放| 亚洲电影第三页| 国产午夜精品美女毛片视频| 91一区在线观看| 奇米精品一区二区三区在线观看| 久久综合九色综合97婷婷女人| 成人美女视频在线看| 午夜精品福利一区二区三区av| 精品国产亚洲在线| 精一区二区三区| 亚洲欧洲日产国产综合网| 91精品一区二区三区在线观看| 国产精品综合在线视频| 亚洲午夜一区二区| 欧美激情综合网| 91精品午夜视频| 91丨porny丨国产入口| 美女在线一区二区| 伊人婷婷欧美激情| 欧美韩日一区二区三区四区| 欧美巨大另类极品videosbest | 亚欧色一区w666天堂| 国产精品毛片久久久久久久| 欧美一区二区高清| 在线观看亚洲成人| 成人av电影在线网| 国产毛片精品视频| 奇米精品一区二区三区在线观看| 亚洲视频在线一区二区| 2023国产精华国产精品| 欧美一区二区三区四区久久| 99re热视频这里只精品| 精品亚洲免费视频| 日韩精品电影一区亚洲| 亚洲一二三四区| 亚洲欧美日韩系列| 18成人在线观看| 国产女人水真多18毛片18精品视频| 欧美久久久久久久久中文字幕| 成人网在线播放| 国产精品99久久久久久有的能看| 美女一区二区久久| 久久成人免费电影| 免费观看日韩电影| 麻豆成人在线观看| 免费视频一区二区| 蜜臀av性久久久久蜜臀av麻豆| 日韩精品福利网| 全国精品久久少妇| 日本视频在线一区| 精品一区二区在线看| 久久成人免费电影| 国产乱人伦偷精品视频免下载| 国产尤物一区二区在线 | 国产午夜精品一区二区三区视频 | 欧美成人一级视频| 精品国内片67194| 国产亚洲一区二区在线观看| 久久久久久麻豆| 国产农村妇女精品| 中文字幕国产一区二区| 国产精品久久久久久亚洲伦| 91精品婷婷国产综合久久性色| 欧美精品aⅴ在线视频| 欧美精品丝袜中出| 精品国产一区二区三区忘忧草| 精品久久五月天| 久久久亚洲国产美女国产盗摄| 国产欧美日韩久久| 亚洲欧美日韩久久精品| 午夜精品久久久久久久久久久| 免费成人性网站| 国产高清视频一区| 91啦中文在线观看| 欧美精品丝袜久久久中文字幕| 日韩欧美一区二区三区在线| 久久综合色之久久综合| 日韩理论在线观看| 日韩成人dvd| 国产a视频精品免费观看| 色一情一伦一子一伦一区| 91精品国产免费| 亚洲国产高清aⅴ视频| 亚洲一区电影777| 国产一区二区按摩在线观看| 91免费国产视频网站| 精品日产卡一卡二卡麻豆| 亚洲品质自拍视频网站| 美女网站一区二区| 97国产一区二区| 精品少妇一区二区三区日产乱码 | 777a∨成人精品桃花网| 国产女主播视频一区二区| 亚洲r级在线视频| 91在线porny国产在线看|