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

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

?? idnntp.pas

?? delphi indy9.0.18組件包
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
{ $HDR$}
{**********************************************************************}
{ Unit archived using Team Coherence                                   }
{ Team Coherence is Copyright 2002 by Quality Software Components      }
{                                                                      }
{ For further information / comments, visit our WEB site at            }
{ http://www.TeamCoherence.com                                         }
{**********************************************************************}
{}
{ $Log:  10271: IdNNTP.pas 
{
{   Rev 1.3    5/12/04 9:53:40 AM  RLebeau
{ Updated GetArticle() to call ReceiveBody() only if ReceiveHeader() does not
{ receive the message terminator first
{ 
{ Updated various methods that return a Boolean to actually look at the  return
{ value of SendCmd() when setting the method Result
}
{
{   Rev 1.2    11/11/03 11:06:40 AM  RLebeau
{ Updated SendCmd() to test for a 281 response when issuing an AUTHINFO USER
{ command, as per RFC 2980
}
{
{   Rev 1.1    9/10/2003 03:19:00 AM  JPMugaas
{ Updated GetArticle(), GetBody(), and GetHeader() to use new
{ EnsureMsgIDBrackets() function in IdGlobal.  Checked in on behalf of Remy
{ Lebeau
}
{
{   Rev 1.0    2002.11.12 10:47:18 PM  czhower
}
unit IdNNTP;

interface

uses
  Classes,
  IdAssignedNumbers,
  IdException,
  IdGlobal,
  IdMessage, IdMessageClient,
  IdTCPServer, IdTCPConnection;

{
  2001-Dec - Chad Z. Hower a.k.a. Kudzu
    -Continued modifications
  2001-Oct - Chad Z. Hower a.k.a. Kudzu
    -Massive reworking to fit the Indy 9 model and update a lot of outdated code
     that was left over from Delphi 4 days. Updates now use overloaded functins. There were also
     several problems with message number accounting.
  2000-Jun-23 J. Peter Mugaas
    -GetNewGroupsList, GetNewGroupsList, and GetNewNewsList No longer require
     an Event handler if you provide a TStrings to those procedures
    -ParseXOVER was added so that you could parse XOVER data
    -ParseNewsGroup was ripped from GetNewGroupsList so that newsgroups can
     be parsed while not downloading newsgroups
    -Moved some duplicate code into a separate procedure
    -The IdNNTP now uses the Indy exceptions and IdResourceStrings to facilitate
     internationalization
  2000-Apr=28 Mark L. Holmes
    -Ported to Indy
  2000-Apr-28
    -Final Version
  1999-Dec-29 MTL
    -Moved to new Palette Scheme (Winshoes Servers)
  Ammended and modified by: AHeid, Mark Holmes
  Original Author: Chad Z. Hower a.k.a. Kudzu
}

type
  // Most users of this component should use "mtReader"
  TModeType = (mtStream, mtIHAVE, mtReader);
  TIdNNTPPermission = (crCanPost, crNoPost, crAuthRequired, crTempUnavailable);
  TModeSetResult = (mrCanStream, mrNoStream, mrCanIHAVE, mrNoIHAVE, mrCanPost, mrNoPost);
  TEventStreaming = procedure (const AMesgID: string; var AAccepted: Boolean)of object;
  TNewsTransportEvent = procedure (AMsg: TStringList) of object;
  TEventNewsgroupList = procedure(const ANewsgroup: string; const ALow, AHigh: Integer;
		const AType: string; var ACanContinue: Boolean) of object;

  TEventNewNewsList = procedure(const AMsgID: string; var ACanContinue: Boolean) of object;

  TIdNNTP = class(TIdMessageClient)
  protected
    FlMsgHigh: Integer;
    FlMsgLow: Integer;
    FlMsgCount: Integer;
    FNewsAgent: string;
    FOnNewsgroupList,
    FOnNewGroupsList: TEventNewsgroupList;
    FOnNewNewsList: TEventNewNewsList;
    FModeType: TModeType;
    FModeResult: TModeSetResult;
    FPermission: TIdNNTPPermission;
    //
    function ConvertDateTimeDist(ADate: TDateTime; AGMT: boolean;
     const ADistributions: string): string;
    procedure ProcessGroupList(const ACmd: string; const AResponse: integer;
     const AListEvent: TEventNewsgroupList);
  public
    procedure Check(AMsgIDs: TStringList; var AResponses: TStringList);
    procedure Connect(const ATimeout: Integer = IdTimeoutDefault); override;
    constructor Create(AOwner: TComponent); override;
    procedure Disconnect; override;
    function GetArticle(AMsg: TIdMessage): Boolean; overload;
    function GetArticle(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
    function GetArticle(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
    function GetArticle(AMsg: TStrings): Boolean; overload;
    function GetArticle(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
    function GetArticle(const AMsgID: string; AMsg: TStrings): Boolean; overload;
    function GetArticle(AMsg: TStream): Boolean; overload;
    function GetArticle(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
    function GetArticle(const AMsgID: string; AMsg: TStream): Boolean; overload;
    function GetBody(AMsg: TIdMessage): Boolean; overload;
    function GetBody(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
    function GetBody(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
    function GetBody(AMsg: TStrings): Boolean; overload;
    function GetBody(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
    function GetBody(const AMsgID: string; AMsg: TStrings): Boolean; overload;
    function GetBody(AMsg: TStream): Boolean; overload;
    function GetBody(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
    function GetBody(const AMsgID: string; AMsg: TStream): Boolean; overload;
    function GetHeader(AMsg: TIdMessage): Boolean; overload;
    function GetHeader(const AMsgNo: Integer; AMsg: TIdMessage): Boolean; overload;
    function GetHeader(const AMsgID: string; AMsg: TIdMessage): Boolean; overload;
    function GetHeader(AMsg: TStrings): Boolean; overload;
    function GetHeader(const AMsgNo: Integer; AMsg: TStrings): Boolean; overload;
    function GetHeader(const AMsgID: string; AMsg: TStrings): Boolean; overload;
    function GetHeader(AMsg: TStream): Boolean; overload;
    function GetHeader(const AMsgNo: Integer; AMsg: TStream): Boolean; overload;
    function GetHeader(const AMsgID: string; AMsg: TStream): Boolean; overload;
    procedure GetNewsgroupList; overload;
    procedure GetNewsgroupList(AList: TStrings); overload;
    procedure GetNewsgroupList(AStream: TStream); overload;
    procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
     const ADistributions: string); overload;
    procedure GetNewGroupsList(const ADate: TDateTime; const AGMT: boolean;
     const ADistributions: string; AList : TStrings); overload;
    procedure GetNewNewsList(const ANewsgroups: string;
      const ADate: TDateTime; const AGMT: boolean; ADistributions: string); overload;
    procedure GetNewNewsList(const ANewsgroups: string; const ADate: TDateTime;
      const AGMT: boolean; ADistributions: string; AList : TStrings); overload;
    procedure GetOverviewFMT(var AResponse: TStringList);
    procedure IHAVE(AMsg: TStringList);
    function Next: Boolean;
    function Previous: Boolean;
    procedure ParseXOVER(Aline: String; var AArticleIndex : Integer; var ASubject,
     AFrom : String; var ADate : TDateTime; var AMsgId, AReferences : String; var AByteCount,
     ALineCount : Integer; var AExtraData : String);
    procedure ParseNewsGroup(ALine : String; var ANewsGroup : String; var AHi, ALo : Integer;
     var AStatus : String);
    procedure Post(AMsg: TIdMessage); overload;
    procedure Post(AStream: TStream); overload;
    function SendCmd(const AOut: string; const AResponse: Array of SmallInt): SmallInt; override;
    function SelectArticle(const AMsgNo: Integer): Boolean;
    procedure SelectGroup(const AGroup: string);
    function TakeThis(const AMsgID: string; AMsg: TStream): string;
    procedure XHDR(const AHeader: string; const AParam: string; AResponse: TStrings);
    procedure XOVER(const AParam: string; AResponse: TStrings); overload;
    procedure XOVER(const AParam: string; AResponse: TStream); overload;
    //
    property ModeResult: TModeSetResult read FModeResult write FModeResult;
    property MsgCount: Integer read flMsgCount;
    property MsgHigh: Integer read FlMsgHigh;
    property MsgLow: Integer read FlMsgLow;
    property Permission: TIdNNTPPermission read FPermission;
  published
    property NewsAgent: string read FNewsAgent write FNewsAgent;
    property Mode: TModeType read FModeType write FModeType default mtReader;
    property Password;
    property Username;
    property OnNewsgroupList: TEventNewsgroupList read FOnNewsgroupList write FOnNewsgroupList;
    property OnNewGroupsList: TEventNewsGroupList read FOnNewGroupsList write FOnNewGroupsList;
    property OnNewNewsList: TEventNewNewsList read FOnNewNewsList write FOnNewNewsList;
    property Port default IdPORT_NNTP;
  end;

  EIdNNTPException = class(EIdException);
  EIdNNTPNoOnNewGroupsList = class(EIdNNTPException);
  EIdNNTPNoOnNewNewsList = class(EIdNNTPException);
  EIdNNTPNoOnNewsgroupList = class(EIdNNTPException);
  EIdNNTPStringListNotInitialized = class(EIdNNTPException);
  EIdNNTPConnectionRefused = class (EIdProtocolReplyError);

implementation

uses
  IdComponent,
  IdResourceStrings,
  SysUtils;

Procedure TIdNNTP.ParseXOVER(Aline : String; var AArticleIndex : Integer;
  var ASubject,
      AFrom : String;
  var ADate : TDateTime;
  var AMsgId,
      AReferences : String;
  var AByteCount,
      ALineCount : Integer;
  var AExtraData : String);

begin
  {Strip backspace and tab junk sequences which occur after a tab separator so they don't throw off any code}
  ALine := StringReplace(ALine,#9#8#9,#9,[rfReplaceAll]);
  {Article Index}
  AArticleIndex := StrToCard ( Fetch( ALine, #9 ) );
  {Subject}
  ASubject := Fetch ( ALine, #9 );
  {From}
  AFrom := Fetch ( ALine, #9 );
  {Date}
  ADate := GMTToLocalDateTime ( Fetch ( Aline, #9 ) );
  {Message ID}
  AMsgId := Fetch ( Aline, #9 );
  {References}
  AReferences := Fetch( ALine, #9);
  {Byte Count}
  AByteCount := StrToCard(Fetch(ALine,#9));
  {Line Count}
  ALineCount := StrToCard(Fetch(ALine,#9));
  {Extra data}
  AExtraData := ALine;
end;

Procedure TIdNNTP.ParseNewsGroup(ALine : String; var ANewsGroup : String;
            var AHi, ALo : Integer;
            var AStatus : String);
begin
  ANewsgroup := Fetch(ALine, ' ');
  AHi := StrToCard(Fetch(Aline, ' '));
  ALo := StrToCard(Fetch(ALine, ' '));
  AStatus := ALine;
end;

constructor TIdNNTP.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  Mode := mtReader;
  Port := IdPORT_NNTP;
end;

function TIdNNTP.SendCmd(const AOut: string; const AResponse: Array of SmallInt): SmallInt;
begin
  // NOTE: Responses must be passed as arrays so that the proper inherited SendCmd is called
  // and a stack overflow is not caused.
  Result := inherited SendCmd(AOut, []);
  if (Result = 480) or (Result = 450) then begin
    // RLebeau - RFC 2980 says that if the password is not required,
    // then 281 will be returned for the username request, not 381.
    if (inherited SendCmd('AUTHINFO USER ' + Username, [281, 381]) = 381) then begin
      inherited SendCmd('AUTHINFO PASS ' + Password, 281);
    end;
    Result := inherited SendCmd(AOut, AResponse);
  end else begin
    CheckResponse(Result, AResponse);
  end;
end;

procedure TIdNNTP.Connect(const ATimeout: Integer = IdTimeoutDefault);
begin
  inherited;
  try
    GetResponse([]);
    // Here lets check to see what condition we are in after being greeted by
    // the server. The application utilizing NNTPWinshoe should check the value
    // of GreetingResult to determine if further action is warranted.

    case LastCmdResult.NumericCode of
      200: FPermission := crCanPost;
      201: FPermission := crNoPost;
      400: FPermission := crTempUnavailable;
      // This should never happen because the server should immediately close
      // the connection but just in case ....
      // Kudzu: Changed this to an exception, otherwise it produces non-standard usage by the
      // users code
      502: raise EIdNNTPConnectionRefused.CreateError(502, RSNNTPConnectionRefused);
    end;
    // here we call Setmode on the value stored in mode to make sure we can
    // use the mode we have selected
    case Mode of
      mtStream: begin
        SendCmd('MODE STREAM');
        if LastCmdResult.NumericCode <> 203 then begin
          ModeResult := mrNoStream
        end else begin
          ModeResult := mrCanStream;
        end;
      end;
      mtReader: begin
        // We should get the same info we got in the greeting
        // result but we set mode to reader anyway since the
        // server may want to do some internal reconfiguration
        // if it knows that a reader has connected
        SendCmd('MODE READER');
        if LastCmdResult.NumericCode <> 200 then begin
          ModeResult := mrNoPost;
        end else begin
          ModeResult := mrCanPost;
        end;
      end;
    end;
  except
    Disconnect;
    Raise;
  end;
end;

procedure TIdNNTP.Disconnect;
begin
  try
    if Connected then begin
      WriteLn('Quit');
    end;
  finally
    inherited;
  end;
end;

{ This procedure gets the overview format as suported by the server }
procedure TIdNNTP.GetOverviewFMT(var AResponse: TStringList);
begin
  SendCmd('LIST OVERVIEW.FMT', 215);
  Capture(AResponse);
end;

{ Send the XOVER Command.  XOVER [Range]
  Range can be of the form: Article Number i.e. 1
                            Article Number followed by a dash
                            Article Number followed by a dash and aother number
  Remember to select a group first and to issue a GetOverviewFMT so that you
  can interpret the information sent by the server corectly. }
procedure TIdNNTP.XOVER(const AParam: string; AResponse: TStrings);
begin
  SendCmd('XOVER ' + AParam, 224);
  Capture(AResponse);
end;

procedure TIdNNTP.XOVER(const AParam: string; AResponse: TStream);
begin
  SendCmd('XOVER ' + AParam, 224);
  Capture(AResponse);
end;

{ Send the XHDR Command.  XHDR Header (Range | Message-ID)
  Range can be of the form: Article Number i.e. 1
                            Article Number followed by a dash
                            Article Number followed by a dash and aother number
  Parm is either the Range or the MessageID of the articles you want. They
  are Mutually Exclusive}
procedure TIdNNTP.XHDR(const AHeader: string; const AParam: String; AResponse: TStrings);
begin
  { This method will send the XHDR command.
  The programmer is responsible for choosing the correct header. Headers
  that should always work as per RFC 1036 are:

      From
      Date
      Newsgroups
      Subject
      Message-ID

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美国av一区二区| 在线精品视频一区二区| 色综合色综合色综合色综合色综合| 色综合久久天天| 久久久久国产精品免费免费搜索| 亚洲综合久久av| 成人av免费观看| 26uuu精品一区二区| 亚洲成人精品在线观看| 色综合久久综合| 国产精品久久久久桃色tv| 精品在线视频一区| 日韩欧美国产一二三区| 亚洲乱码国产乱码精品精98午夜 | 国产99精品视频| 欧美剧情电影在线观看完整版免费励志电影 | 久久久激情视频| 久久99精品久久久久婷婷| 在线不卡的av| 日韩精品一区第一页| 91天堂素人约啪| 17c精品麻豆一区二区免费| 国产精品一区免费视频| 2024国产精品| 国内精品视频666| 久久综合九色综合97婷婷女人| 日韩电影在线免费看| 欧美肥妇毛茸茸| 日韩国产在线观看| 日韩美女一区二区三区四区| 日本网站在线观看一区二区三区 | 欧美撒尿777hd撒尿| 亚洲电影视频在线| 欧美午夜不卡视频| 视频一区视频二区中文字幕| 91精品在线观看入口| 视频一区视频二区中文| 日韩午夜三级在线| 国产一区高清在线| 国产清纯在线一区二区www| 国产成人高清视频| 亚洲精品国产第一综合99久久 | 在线亚洲高清视频| 亚洲成a人v欧美综合天堂| 欧美一区二区在线免费观看| 九九**精品视频免费播放| 久久精品免费在线观看| 99在线热播精品免费| 亚洲午夜激情av| 精品久久人人做人人爰| thepron国产精品| 亚洲成人1区2区| 精品美女在线播放| 99久久婷婷国产| 午夜av一区二区| 久久久三级国产网站| 99国产精品国产精品毛片| 亚洲一区二区不卡免费| 欧美tickling网站挠脚心| 岛国一区二区在线观看| 亚洲一二三区不卡| 久久久久久免费| 欧美日韩一区二区不卡| 激情综合亚洲精品| 亚洲一区二区三区自拍| 久久色在线视频| 欧美中文字幕久久| 国产99精品在线观看| 午夜视频一区在线观看| 国产女主播一区| 91 com成人网| 91在线无精精品入口| 久久av老司机精品网站导航| 亚洲男人天堂av| 久久精品一区八戒影视| 欧美日韩在线电影| av在线一区二区| 狠狠色伊人亚洲综合成人| 亚洲在线视频网站| 国产精品久久久久久久久果冻传媒 | 久久成人综合网| 一区二区三区资源| 国产网红主播福利一区二区| 欧美一级一区二区| 欧美视频在线观看一区二区| 国产白丝精品91爽爽久久| 日本在线不卡一区| 亚洲大片精品永久免费| 亚洲视频电影在线| 国产精品乱码一区二区三区软件| 欧美一区二区三区系列电影| 欧美性大战久久| 成人福利在线看| 国产不卡高清在线观看视频| 经典一区二区三区| 激情六月婷婷久久| 久久国产尿小便嘘嘘尿| 五月婷婷综合网| 亚洲一区二区三区在线| 一区二区三区在线不卡| 中文字幕亚洲一区二区va在线| 国产视频一区二区在线| 久久亚洲影视婷婷| 欧美成人官网二区| 久久青草欧美一区二区三区| 日韩欧美自拍偷拍| 欧美v国产在线一区二区三区| 欧美高清dvd| 日韩色在线观看| 日韩精品一区二区三区四区| 日韩美一区二区三区| 欧美xxxxx牲另类人与| 精品91自产拍在线观看一区| 精品国产伦一区二区三区观看方式| 欧美日本乱大交xxxxx| 欧美精品日韩精品| 欧美一级视频精品观看| 欧美成人官网二区| 国产拍欧美日韩视频二区| 国产日韩欧美不卡| 亚洲欧美日韩国产成人精品影院| 亚洲欧美日韩综合aⅴ视频| 一区二区在线观看免费视频播放| 亚洲综合清纯丝袜自拍| 婷婷成人激情在线网| 美女久久久精品| 国产高清久久久| 91同城在线观看| 欧美猛男超大videosgay| 日韩色视频在线观看| 久久伊人中文字幕| 亚洲男同性恋视频| 日韩成人一级片| 成人一区二区视频| 欧美视频一区二区三区在线观看| 制服.丝袜.亚洲.另类.中文| 久久美女高清视频| 亚洲老司机在线| 秋霞成人午夜伦在线观看| 久久精品国产第一区二区三区| 国产精品正在播放| 在线影院国内精品| 欧美va日韩va| 亚洲黄色在线视频| 激情综合网av| 日本福利一区二区| 欧美精品一区男女天堂| 自拍av一区二区三区| 日本aⅴ免费视频一区二区三区 | 蜜臀av一区二区在线观看| 高清不卡在线观看av| 欧美丝袜丝交足nylons| 久久你懂得1024| 一个色综合网站| 国产成人夜色高潮福利影视| 欧洲一区在线电影| 久久久久久久网| 五月天一区二区| 99久久精品国产网站| 欧美一卡二卡三卡四卡| 亚洲精品视频免费观看| 国产精品中文欧美| 欧美精品一二三| 自拍偷在线精品自拍偷无码专区| 奇米影视一区二区三区| 91福利区一区二区三区| 日本一区二区三区在线观看| 亚洲在线一区二区三区| 成人在线一区二区三区| 日韩欧美一级二级| 亚洲一区在线电影| kk眼镜猥琐国模调教系列一区二区 | 中文字幕综合网| 国产精品一卡二卡在线观看| 这里是久久伊人| 亚洲6080在线| 色老头久久综合| 中文字幕一区二区在线播放| 国产又黄又大久久| 日韩一区二区免费电影| 亚洲成av人影院| 色94色欧美sute亚洲线路二| 国产精品三级av| 国产成人在线观看| 久久久久高清精品| 精品一区二区三区视频在线观看| 欧美精品日韩综合在线| 亚洲第一在线综合网站| 欧美日韩高清一区二区三区| 亚洲欧美偷拍卡通变态| av一本久道久久综合久久鬼色| 久久久久国色av免费看影院| 国产在线一区二区| 精品999久久久| 国产精品主播直播| 国产日韩欧美麻豆| 成人av电影免费在线播放| 欧美国产精品劲爆| 成人在线视频一区二区| 欧美激情一区二区在线|