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

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

?? nntpcli.pas

?? 包含常用Internet協議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一区二区三区免费野_久草精品视频
午夜视频久久久久久| 国产日韩v精品一区二区| 国产成人午夜精品5599| 日韩精品国产精品| 日韩精品视频网站| 午夜伊人狠狠久久| 午夜久久久久久久久久一区二区| 亚洲一区二区av电影| 亚洲一区二区三区四区五区黄| 亚洲一区精品在线| 午夜婷婷国产麻豆精品| 天天影视涩香欲综合网| 免费在线看一区| 国产一区二区不卡在线| 99久久免费精品高清特色大片| 不卡一二三区首页| 在线观看免费亚洲| 日韩三级中文字幕| 久久精品一区二区三区av| 国产欧美1区2区3区| 亚洲品质自拍视频| 日本亚洲一区二区| 狠狠网亚洲精品| 99久久婷婷国产综合精品电影 | 久久亚洲精精品中文字幕早川悠里 | 久久99精品久久久久| 丰满少妇久久久久久久| 91麻豆免费看| 日韩欧美国产一区在线观看| 久久久精品人体av艺术| 一区二区高清免费观看影视大全 | 麻豆91免费观看| 成人一级黄色片| 欧美制服丝袜第一页| 精品国产露脸精彩对白| 亚洲免费观看高清在线观看| 日本免费新一区视频| 不卡在线视频中文字幕| 欧美理论在线播放| 欧美激情一区二区三区在线| 亚洲一区二区三区中文字幕 | 国产无一区二区| 亚洲图片欧美综合| 国产乱码精品一区二区三区av| 91美女片黄在线观看| 久久亚洲欧美国产精品乐播| 亚洲综合色丁香婷婷六月图片| 国产精一品亚洲二区在线视频| 欧美在线观看视频在线| 中文欧美字幕免费| 美女www一区二区| 欧美私模裸体表演在线观看| 国产丝袜在线精品| 精品在线你懂的| 欧美日韩精品一区二区三区| 中文字幕在线观看不卡视频| 国产乱子轮精品视频| 欧美精品乱人伦久久久久久| 亚洲精品久久7777| 色婷婷狠狠综合| 亚洲欧美日韩一区二区三区在线观看| 精品日韩在线观看| 亚洲电影在线免费观看| 成人国产精品免费观看动漫| 久久亚区不卡日本| 久久精品国内一区二区三区| 欧美丰满少妇xxxxx高潮对白| 玉米视频成人免费看| 色综合久久中文字幕综合网| 国产精品免费视频网站| 成人午夜免费视频| 中文字幕精品一区二区三区精品| 国产在线播放一区二区三区| 精品少妇一区二区| 国产在线播放一区| 国产午夜精品一区二区三区嫩草 | 一级特黄大欧美久久久| 99精品欧美一区二区三区小说| 国产精品午夜久久| 99国产精品国产精品久久| 亚洲视频在线一区观看| 色88888久久久久久影院按摩| 亚洲免费av在线| 精品视频1区2区3区| 亚洲sss视频在线视频| 欧美一级专区免费大片| 国产一区二区三区日韩| 中文字幕精品一区二区精品绿巨人| 99视频一区二区| 亚洲五码中文字幕| 精品日韩成人av| 国产成人高清在线| 一级做a爱片久久| 日韩一区二区三区视频| 国产在线视频一区二区三区| 国产精品久久久久久久久免费桃花 | 欧美不卡在线视频| 国产麻豆91精品| 亚洲色图视频网| 欧美一级日韩免费不卡| 丁香一区二区三区| 亚洲超碰精品一区二区| 久久久久久9999| 91久久久免费一区二区| 另类综合日韩欧美亚洲| 国产欧美一区二区在线观看| 欧美自拍丝袜亚洲| 狠狠色狠狠色综合| 亚洲欧美日韩国产综合在线| 日韩一区二区在线播放| 成人午夜激情视频| 天天av天天翘天天综合网色鬼国产| 26uuu亚洲综合色欧美| 欧美图片一区二区三区| 国产69精品久久久久毛片| 午夜视频在线观看一区二区三区| 欧美精品一区二区三区高清aⅴ | 在线观看国产一区二区| 久久99精品视频| 亚洲制服丝袜在线| 欧美国产亚洲另类动漫| 精品99一区二区| 97久久超碰精品国产| 免费人成精品欧美精品| 国产精品麻豆久久久| 日韩免费电影一区| 在线观看av一区二区| 成人免费va视频| 狠狠色狠狠色综合日日91app| 亚洲国产一区二区视频| 中文字幕一区二| 国产喷白浆一区二区三区| 欧美v亚洲v综合ⅴ国产v| 欧美三级一区二区| 99久久婷婷国产综合精品| 国产成人午夜视频| 国产一区欧美日韩| 久久国产麻豆精品| 免费看日韩精品| 亚洲成a人在线观看| 亚洲一本大道在线| 一区二区三区精品| 亚洲久草在线视频| 中文字幕一区二区三区精华液 | 麻豆视频观看网址久久| 视频在线观看91| 午夜日韩在线观看| 亚洲亚洲人成综合网络| 亚洲精品国产无套在线观| 欧美激情综合五月色丁香小说| 日韩精品中午字幕| 91精品国产福利在线观看| 欧美日韩久久一区二区| 欧美日韩免费一区二区三区视频| 欧美性猛交xxxx黑人交| 欧美巨大另类极品videosbest| 色婷婷综合激情| 色激情天天射综合网| 91黄色激情网站| 欧美久久久久久蜜桃| 欧美一级理论性理论a| 欧美sm美女调教| 欧美精品一区二区三区蜜桃| 国产片一区二区三区| 亚洲视频在线观看三级| 亚洲男人天堂一区| 五月天视频一区| 久久99国内精品| 成人黄页毛片网站| 91麻豆文化传媒在线观看| 91国模大尺度私拍在线视频| 欧美麻豆精品久久久久久| 欧美α欧美αv大片| 中文欧美字幕免费| 亚洲风情在线资源站| 久久福利资源站| 菠萝蜜视频在线观看一区| 欧美亚洲日本国产| 日韩欧美国产三级电影视频| 国产精品萝li| 天天免费综合色| 国产99精品在线观看| 欧美日韩一二三区| 26uuu国产日韩综合| 亚洲欧美一区二区三区国产精品 | 欧美激情一区二区| 亚洲国产视频在线| 久久黄色级2电影| 91小视频在线免费看| 91精品国产91综合久久蜜臀| 欧美国产日本视频| 天天综合网 天天综合色| 国产99久久久国产精品免费看| 欧美日韩国产美| 亚洲欧美综合另类在线卡通| 日产国产高清一区二区三区| av成人老司机| 精品国产一二三| 一区二区三区中文字幕电影 | 日产精品久久久久久久性色|