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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nntpcli.pas

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

Author:       Fran鏾is PIETTE
Description:  TNntpCli is a client for the NNTP protocol (RFC-977)
Creation:     December 19, 1997
Version:      1.07
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.

Updates:
Dec 30, 1997  V0.91 Bug: StatusCode was not updated for Connect
              Added PostingPermited property and ParseListLine procedure as
              suggested by J. Peter Mugaas <oma00215@mail.wvnet.edu>
Dec 31, 1997  V0.92 Added XOVER, LIST OVERVIEW.FMT and DATE commands
Jan 10, 1998  V0.93 Added OnStateChange event as suggested by J. Peter Mugaas
              <oma00215@mail.wvnet.edu>
Jan 13, 1998  V0.94 Added readonly property State
Feb 02, 1998  V0.95 Corrected a message in the Quit method.
              Added the NntpCliVersion constant.
Feb 03, 1998  V0.96 Added Authenticate method, UserName and PassWord properties.
Apr 13, 1998  V1.00 Added an intermediate message for OnRequestDone event
              Created the Handle property and related WndProc stuff
Apr 21, 1998  V1.01 Corrected buffer overflow in the OnDataAvailable event.
              Thanks to Tim Skinner tim@palacecs.demon.co.uk who found that bug.
Sep 29, 1998  V1.02 Checked length of FLastResponse before writing it to stream.
              Thanks to Michael Bartos <MBartos@ExpoMedia.de> for the hint.
Feb 01, 1999  V1.03 Added nntpConnect to solve connection problem after an
              abort. Thanks to Eric Fortier <efortier@videotron.ca>.
Feb 27, 1999  V1.04 Made Connect, Abort and Quit method virtual so that they
              can be overriden in descending components.
              Checked line length in ParseListLine.
Mar 31, 1999  V1.05 Made all methods virtual.
Aug 14, 1999  V1.06 Implemented MODE READER and XHDR
Aug 20, 1999  V1.07 Revised conditional compilation, adapted for BCB4, set
              compile options same as TWSocket.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit NntpCli;

{.DEFINE DUMP}

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, SysUtils, Messages, Classes, Forms, WinSock, WSocket;

const
    NntpCliVersion     = 107;
    CopyRight : String = ' TNntpCli (c) 1997-2000 F. Piette V1.07 ';
{$IFDEF VER80}
    { Delphi 1 has a 255 characters string limitation }
    NNTP_RCV_BUF_SIZE = 255;
{$ELSE}
    NNTP_RCV_BUF_SIZE = 4096;
{$ENDIF}
  WM_NNTP_REQUEST_DONE = WM_USER + 1;

type
    TNntpDisplay = procedure(Sender: TObject; Msg : PChar; Len : Integer) of object;
    TNntpState = (nntpNotConnected, nntpDnsLookup, nntpWaitingBanner,
                  nntpReady, nntpWaitingResponse);
    TNntpRequest = (nntpGroup,           nntpList,         nntpConnect,
                    nntpPost,            nntpHelp,
                    nntpNewGroups,       nntpNewNews,
                    nntpArticleByNumber, nntpArticleByID,
                    nntpBodyByID,        nntpBodyByNumber,
                    nntpHeadByID,        nntpHeadByNumber,
                    nntpStatByID,        nntpStatByNumber,
                    nntpNext,            nntpLast,
                    nntpQuit,            nntpAbort,
                    nntpXOver,           nntpListOverViewFmt,
                    nntpDate,            nntpAuthenticate,
                    nntpModeReader,      nntpXHdr);
    TRequestDone = procedure(Sender: TObject; RqType: TNntpRequest; Error: Word) of object;

    NntpException = class(Exception);

    TNntpCli = class(TComponent)
        constructor Create(AOwner: TComponent); override;
        destructor  Destroy; override;
        procedure   Connect; virtual;
        procedure   Abort; virtual;
        procedure   Quit; virtual;
        procedure   Group(NewsGroupName : String); virtual;
        procedure   ArticleByNumber(Number : Integer; DestStream : TStream); virtual;
        procedure   ArticleByID(ID : String; DestStream : TStream); virtual;
        procedure   HeadByNumber(Number : Integer; DestStream : TStream); virtual;
        procedure   HeadByID(ID : String; DestStream : TStream); virtual;
        procedure   BodyByNumber(Number : Integer; DestStream : TStream); virtual;
        procedure   BodyByID(ID : String; DestStream : TStream); virtual;
        procedure   StatByNumber(Number : Integer); virtual;
        procedure   StatByID(ID : String); virtual;
        procedure   Next; virtual;
        procedure   Last; virtual;     { It is really Prior, but RFC-977 call it Last !}
        procedure   List(DestStream : TStream); virtual;
        procedure   Post(FromStream : TStream); virtual;
        procedure   Help(DestStream : TStream); virtual;
        procedure   Authenticate; virtual;
        procedure   XOver(Articles : String; DestStream : TStream); virtual;
        procedure   ListOverViewFmt(DestStream : TStream); virtual;
        procedure   Date; virtual;
        procedure   ModeReader; virtual;
        procedure   XHdr(DestStream : TStream;
                         Header     : String;
                         Range      : String); virtual;
        procedure   NewGroups(When          : TDateTime;
                              GMTFLag       : Boolean;
                              Distributions : String;
                              DestStream    : TStream);  virtual;
        procedure   NewNews(When          : TDateTime;
                            GMTFLag       : Boolean;
                            NewsGroupName : String;
                            Distributions : String;
                            DestStream    : TStream); virtual;
    protected
        FWindowHandle       : HWND;
{$IFDEF DUMP}
        FDumpStream         : TFileStream;
        FDumpBuf            : String;
{$ENDIF}
        FHost               : String;
        FState              : TNntpState;
        FWSocket            : TWSocket;
        FRequest            : String;
        FRequestType        : TNntpRequest;
        FRequestDoneFlag    : Boolean;
        FSentFlag           : Boolean;
        FStatusCode         : Integer;
        FSendBuffer         : array [0..NNTP_RCV_BUF_SIZE - 1] of char;
        FReceiveBuffer      : array [0..NNTP_RCV_BUF_SIZE - 1] of char;
        FReceiveLen         : Integer;
        FLastResponse       : String;
        FLastCmdResponse    : String;
        FErrorMessage       : String;
        FArticleEstimated   : Integer;
        FArticleFirst       : Integer;
        FArticleLast        : Integer;
        FArticleNumber      : Integer;
        FArticleID          : String;
        FServerDate         : TDateTime;
        FDataStream         : TStream;
        FUserName           : String;
        FPassWord           : String;
        FNext               : procedure of object;
        FPostingPermited    : Boolean;
        FOnSessionConnected : TSessionConnected;
        FOnSessionClosed    : TSessionClosed;
        FOnDataAvailable    : TDataAvailable;
        FOnRequestDone      : TRequestDone;
        FOnDisplay          : TNntpDisplay;
        FOnMessageBegin     : TNotifyEvent;
        FOnMessageEnd       : TNotifyEvent;
        FOnMessageLine      : TNotifyEvent;
        FOnXHdrBegin        : TNotifyEvent;
        FOnXHdrEnd          : TNotifyEvent;
        FOnXHdrLine         : TNotifyEvent;
        FOnStateChange      : TNotifyEvent;
        procedure WndProc(var MsgRec: TMessage);
        procedure WMNntpRequestDone(var msg: TMessage); message WM_NNTP_REQUEST_DONE;
        procedure WSocketDnsLookupDone(Sender: TObject; Error: Word);
        procedure WSocketSessionConnected(Sender: TObject; Error: Word);
        procedure WSocketDataAvailable(Sender: TObject; Error: Word);
        procedure WSocketSessionClosed(Sender: TObject; Error: Word);
        procedure WSocketDataSent(Sender: TObject; Error: Word);
        procedure TriggerRequestDone(Error: Word); virtual;
        procedure TriggerStateChange; virtual;
        procedure StateChange(NewState : TNntpState); virtual;
        procedure SendRequest; virtual;
        procedure GroupNext; virtual;
        procedure QuitNext; virtual;
        procedure XHdrLineNext; virtual;
        procedure GetArticleNext; virtual;
        procedure GetArticleLineNext; virtual;
        procedure GetArticleByNumber(RqType: TNntpRequest; Number : Integer; DestStream : TStream); virtual;
        procedure GetArticleByID(RqType: TNntpRequest; ID : String; DestStream : TStream); virtual;
        procedure GetArticle(RqType: TNntpRequest; ID : String; DestStream : TStream); virtual;
        procedure PostNext; virtual;
        procedure PostDone; virtual;
        procedure PostBlock; virtual;
        procedure PostSendNext; virtual;
        procedure DateNext; virtual;
        procedure ModeReaderNext; virtual;
        procedure XHdrNext; virtual;
        procedure AuthenticateNext1; virtual;
        procedure AuthenticateNext2; virtual;
        property  Handle        : HWND                  read FWindowHandle;
    published
        property WSocket : TWSocket                     read  FWSocket;
        property State   : TNntpState                   read  FState;
        property Host : String                          read  FHost
                                                        write FHost;
        property ErrorMessage : String                  read  FErrorMessage;
        property LastResponse : String                  read  FLastResponse;
        property StatusCode : Integer                   read  FStatusCode;
        property PostingPermited    : Boolean           read  FPostingPermited;
        property ArticleEstimated   : Integer           read  FArticleEstimated;
        property ArticleFirst       : Integer           read  FArticleFirst;
        property ArticleLast        : Integer           read  FArticleLast;
        property ArticleNumber      : Integer           read  FArticleNumber;
        property ArticleID          : String            read  FArticleID;
        property ServerDate         : TDateTime         read  FServerDate;
        property UserName           : String            read  FUserName
                                                        write FUserName;
        property PassWord           : String            read  FPassWord
                                                        write FPassWord;
        property OnSessionConnected : TSessionConnected read  FOnSessionConnected
                                                        write FOnSessionConnected;
        property OnSessionClosed : TSessionClosed       read  FOnSessionClosed
                                                        write FOnSessionClosed;
        property OnDataAvailable : TDataAvailable       read  FOnDataAvailable
                                                        write FOnDataAvailable;
        property OnRequestDone : TRequestDone           read  FOnRequestDone
                                                        write FOnRequestDone;
        property OnDisplay : TNntpDisplay               read  FOnDisplay
                                                        write FOnDisplay;
        property OnMessageBegin : TNotifyEvent          read  FOnMessageBegin
                                                        write FOnMessageBegin;
        property OnMessageEnd : TNotifyEvent            read  FOnMessageEnd
                                                        write FOnMessageEnd;
        property OnMessageLine : TNotifyEvent           read  FOnMessageLine
                                                        write FOnMessageLine;
        property OnXHdrBegin : TNotifyEvent             read  FOnXHdrBegin
                                                        write FOnXHdrBegin;
        property OnXHdrEnd : TNotifyEvent               read  FOnXHdrEnd
                                                        write FOnXHdrEnd;
        property OnXHdrLine : TNotifyEvent              read  FOnXHdrLine
                                                        write FOnXHdrLine;
        property OnStateChange : TNotifyEvent           read  FOnStateChange
                                                        write FOnStateChange;
    end;

procedure ParseListLine(const Line          : String;
                        var NewsGroupName   : String;
                        var LastArticle     : Integer;
                        var FirstArticle    : Integer;
                        var PostingFlag     : Char);
procedure Register;

implementation


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{$IFDEF VER80}
function TrimRight(Str : String) : String;
var
    i : Integer;
begin
    i := Length(Str);
    while (i > 0) and (Str[i] = ' ') do
        i := i - 1;
    Result := Copy(Str, 1, i);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TrimLeft(Str : String) : String;
var
    i : Integer;
begin
    if Str[1] <> ' ' then
        Result := Str
    else begin
        i := 1;
        while (i <= Length(Str)) and (Str[i] = ' ') do
            i := i + 1;
        Result := Copy(Str, i, Length(Str) - i + 1);
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function Trim(Str : String) : String;
begin
    Result := TrimLeft(TrimRight(Str));
end;
{$ENDIF}


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Step over blank spaces                                                    }
function StpBlk(Data : PChar) : PChar;
begin
    Result := Data;
    if Result <> nil then begin
        while (Result^ <> #0) and (Result^ in [' ', #9, #13, #10]) do
            Inc(Result);
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级资源在线| 日本一区二区久久| 国产精品欧美久久久久一区二区| 亚洲女人小视频在线观看| 美腿丝袜亚洲综合| 在线免费观看一区| 国产精品久久久爽爽爽麻豆色哟哟 | 久久久av毛片精品| 视频一区免费在线观看| 日本乱码高清不卡字幕| 国产精品久久免费看| 精品亚洲国产成人av制服丝袜| 欧美无乱码久久久免费午夜一区| 国产欧美一区在线| 国模套图日韩精品一区二区| 欧美一区二区日韩| 偷拍自拍另类欧美| 欧美人妇做爰xxxⅹ性高电影| 亚洲天堂精品视频| 成人激情免费视频| 中文子幕无线码一区tr| 国产精品一级在线| 久久综合久久综合亚洲| 蜜臂av日日欢夜夜爽一区| 欧美一卡2卡三卡4卡5免费| 亚洲一区在线观看视频| 色偷偷成人一区二区三区91| 中文字幕国产一区| 成人福利电影精品一区二区在线观看| 2021国产精品久久精品| 国内精品伊人久久久久av影院| 日韩精品一区国产麻豆| 极品少妇xxxx精品少妇| 精品国产乱码久久久久久1区2区 | 国产日韩亚洲欧美综合| 国产麻豆视频精品| 国产日韩av一区| 国产一区在线不卡| 中文字幕av不卡| 91福利资源站| 日韩一区精品视频| 日韩欧美电影一区| 风间由美一区二区三区在线观看| 国产精品乱人伦中文| 色94色欧美sute亚洲13| 一区二区三区在线视频免费| 欧美电影在哪看比较好| 蜜乳av一区二区三区| 国产色91在线| 色婷婷国产精品| 男女性色大片免费观看一区二区| 精品久久五月天| 成人av一区二区三区| 亚洲一区二区黄色| 91精品欧美久久久久久动漫| 精品一区二区精品| 亚洲欧洲色图综合| 欧美精品久久久久久久多人混战| 久久黄色级2电影| 国产精品伦理一区二区| 777奇米四色成人影色区| 国产成a人亚洲精品| 亚洲成人av一区| 国产视频一区在线播放| 欧美日韩久久久久久| 国产精品系列在线播放| 亚洲午夜一二三区视频| 国产女人水真多18毛片18精品视频 | 丁香天五香天堂综合| 亚洲图片一区二区| 国产欧美一区二区精品性| 欧美性大战久久久久久久蜜臀| 国产一区二区精品久久99| 亚洲一级不卡视频| 国产女人aaa级久久久级| 这里是久久伊人| 91麻豆国产在线观看| 国产一区二区在线免费观看| 亚洲第一在线综合网站| 国产精品午夜免费| 日韩欧美国产一二三区| 欧美亚洲国产怡红院影院| 国产99久久久国产精品免费看 | 一区二区三区日本| 国产亚洲欧美在线| 日韩免费视频一区| 欧美影片第一页| 91免费视频观看| 成人免费视频一区| 精品午夜一区二区三区在线观看| 亚洲一二三区视频在线观看| 中文字幕亚洲区| 亚洲国产成人私人影院tom | 精品在线观看免费| 三级欧美在线一区| 亚洲成人自拍偷拍| 亚洲乱码国产乱码精品精小说| 精品剧情v国产在线观看在线| 777久久久精品| 欧美日韩三级在线| 欧美日韩精品欧美日韩精品一| 色综合色综合色综合色综合色综合| 国产不卡视频在线播放| 黑人巨大精品欧美一区| 久久精品99国产国产精| 美女久久久精品| 青青草伊人久久| 亚洲第一成年网| 午夜久久久久久电影| 亚洲黄色av一区| 亚洲欧美日韩中文播放| 一区二区三区产品免费精品久久75| 最新热久久免费视频| 日韩理论片中文av| 亚洲另类中文字| 亚洲在线视频一区| 香蕉乱码成人久久天堂爱免费| 亚洲成人综合在线| 蜜臀av一区二区| 国产精一区二区三区| 丰满少妇久久久久久久| 色综合中文字幕| 欧美四级电影在线观看| 欧美日韩一级黄| 日韩欧美中文字幕公布| 久久网站热最新地址| 欧美激情一区二区三区| 亚洲啪啪综合av一区二区三区| 亚洲精品视频在线观看网站| 亚洲成人一区二区| 精品一区二区三区影院在线午夜| 国产一区二区三区免费在线观看| 国产一区二区在线电影| 99在线热播精品免费| 欧美日韩国产大片| 久久免费美女视频| 亚洲黄色尤物视频| 久久黄色级2电影| 色综合久久久久综合99| 欧美人xxxx| 国产亚洲精久久久久久| 亚洲最新在线观看| 裸体在线国模精品偷拍| 成人丝袜高跟foot| 在线综合+亚洲+欧美中文字幕| 久久―日本道色综合久久| 亚洲色图20p| 国模冰冰炮一区二区| 91同城在线观看| 日韩精品一区二区在线| 国产精品久久久久久久久快鸭| 亚洲国产一区在线观看| 国产乱理伦片在线观看夜一区| 成人激情av网| 日韩欧美一二区| 一区二区三区日韩精品视频| 激情综合一区二区三区| 欧美视频中文一区二区三区在线观看 | 在线观看三级视频欧美| 久久精品男人天堂av| 尤物视频一区二区| 成人自拍视频在线观看| 欧美理论电影在线| 亚洲欧洲日韩在线| 激情综合色综合久久综合| 欧美综合视频在线观看| 欧美国产在线观看| 精品一区二区三区视频在线观看| 日本大香伊一区二区三区| 久久日韩粉嫩一区二区三区| 日韩经典一区二区| 色94色欧美sute亚洲线路一久| 久久精品视频免费观看| 麻豆精品一区二区三区| 欧美视频日韩视频在线观看| 成人欧美一区二区三区小说 | 欧美激情在线一区二区| 另类小说图片综合网| 91麻豆精品国产| 亚洲一区影音先锋| 91在线你懂得| 亚洲欧洲日产国码二区| 高清不卡一二三区| 久久午夜电影网| 国产乱人伦精品一区二区在线观看| 91精品国产免费久久综合| 亚洲h精品动漫在线观看| 日本精品一级二级| 亚洲美女电影在线| 91猫先生在线| 亚洲欧美日韩在线不卡| 一本大道久久a久久综合| 中文字幕亚洲综合久久菠萝蜜| 成人黄色777网| 亚洲欧洲日产国码二区| 99re热这里只有精品视频| 中文字幕亚洲不卡| 99麻豆久久久国产精品免费| 中文字幕在线观看一区二区| 色综合久久中文字幕综合网|