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

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

?? tnscript.pas

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

Author:       Fran鏾is PIETTE
Description:  TTnScript component add scripting capabilities to TTnEmulVT
Creation:     February 24th, 1998
Version:      1.03
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) 1998-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.

Quick Reference:

TTnScript is a descendent from TTnEmulVT. It does exactly what TTnEmulVT does
(Ansi terminal emulation) and add some scripting capabilities.
TTnScript follows the received data and search in the data stream for
given strings. When found, an event handler is called.

Strings to search are specified by calling AddEvent. Each string is identified
by an ID (an integer number) which must be unique.

You can remove a string using RemoveEvent, passing the ID you gave when
inserting the string in the list. You can remove all the strings with
RemoveAllEvents.

Each string to search for is associated with another string which will be sent
by the component when the search string is found. This can be used for example
when you search for a login prompt ('login') to send the username when this
prompt is found. Same for password.

Each string to search for is also associated with an event handler which will
be triggered when the string is found, right after having sent the string to
send. This specific event can be used to customize what has to be done when
the string is found (for example update the user interface or query the user
for some value to send).

Finally, each string to search is associated with a set of flags which tells
the component some special actions such as ignoring character case when
comparing text, or make the string persistant (normaly when a string has been
found, it is removed from the list).

Strings are searched in the order they are added to the list. So it can be
very different if you add 'login' and 'password' to search for than if you
add 'login' only and then when 'login' is found, add 'password'.

To scan the data stream, the component use a circular buffer whose dimension
is 80 characters by default. You can change that by assigning InputBufferSize.
The buffer size should be at least twice the size of the longest string to
search. If you use an oversized buffer, you have a performance penalty because
the buffer is searched as each data packet comes into the stream.

An automatic login procedure could looks like this:
    TnScript1.AddEvent(1, 'login',    'root' + #13#10, [efIgnoreCase], nil);
    TnScript1.AddEvent(2, 'password', 'boss' + #13#10, [efIgnoreCase], nil);
    TnScript1.Connect;

The nil argument could be replaced by a procedure (event handler) to make some
computing when the string to search for is found. Here is an example:

    TnScript1.AddEvent(2, 'prompt', '', [efIgnoreCase], PromptEvent);

procedure TForm1.PromptEvent(Sender : TObject; ID : Integer);
begin
    .... Your code goes here. You can do everithing ....
    Label1.Caption := 'Logged !';
    TnScript1.SendStr('ls -l' + #13 + #10);    Like sending some data
end;

Updates:
Mar 14, 1999  V1.01 efIgnoreCase was ignored !
May 13, 1999  V1.02 Made all methods virtual.
Aug 20, 1999  V1.03 Added compile time options. Revised for BCB4.

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit TnScript;

{$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}

interface

{.DEFINE DUMP}

uses
    Wintypes, WinProcs, Classes, SysUtils, TnEmulVT;

const
    TnScriptVersion    = 1.03;
    CopyRight : String = ' TTnScript (c) 1998-2000 F. Piette V1.03 ';

type
    TnScriptException = class(Exception);
    TEventHandler = procedure (Sender : TObject; ID : Integer) of object;
    TEventFlag    = (efIgnoreCase,         { Ignore case in comparaisons   }
                     efPersistent);        {Do not delete event when found }
    TEventFlags   = set of TEventFlag;
    TDisplayEvent = procedure (Sender : TObject; Msg : String) of object;
    TStringMatch  = procedure (Sender : TObject; ID : Integer) of object;

    TEventDescriptor = record
        ID      : Integer;
        Search  : String;
        ToSend  : String;
        Flags   : TEventFlags;
        Handler : TEventHandler;
    end;
    PEventDescriptor = ^TEventDescriptor;

    TTnScript = class(TTnEmulVT)
    protected
        FEventList        : TList;
        FInputBuffer      : PChar;
        FInputBufferSize  : Integer;
        FInputBufferCount : Integer;
        FInputBufferStart : Integer;
        FOnDisplay        : TDisplayEvent;
        FOnStringMatch    : TStringMatch;
        function  SearchEvent(ID : Integer) : Integer; virtual;
        procedure TriggerDataAvailable(Buffer: PChar; Len: Integer); override;
        function  FindEventString(S : String; Flags : TEventFlags) : Integer; virtual;
        procedure ScanEvents; virtual;
        procedure ProcessInputData(Buffer: PChar; Len: Integer); virtual;
        procedure TriggerDisplay(Msg : String); virtual;
        procedure TriggerStringMatch(ID : Integer); virtual;
        procedure NextOne(var N : Integer); virtual;
        procedure SetInputBufferSize(newSize : Integer); virtual;
    public
        constructor Create(AOwner : TComponent); override;
        destructor  Destroy; override;
        procedure AddEvent(ID      : Integer;
                           Search  : String;
                           ToSend  : String;
                           Flags   : TEventFlags;
                           Handler : TEventHandler); virtual;
        procedure RemoveEvent(ID : Integer); virtual;
        procedure RemoveAllEvents; virtual;
    published
        property InputBufferSize : Integer         read  FInputBufferSize
                                                   write SetInputBufferSize;
        property OnDisplay : TDisplayEvent         read  FOnDisplay
                                                   write FOnDisplay;
        property OnStringMatch : TStringMatch      read  FOnStringMatch
                                                   write FOnStringMatch;

    end;

procedure Register;

implementation

{$IFDEF DUMP}
const
    CtrlCode : array [0..31] of String = ('NUL', 'SOH', 'STX', 'ETX',
                                          'EOT', 'ENQ', 'ACK', 'BEL',
                                          'BS',  'HT',  'LF',  'VT',
                                          'FF',  'CR',  'SO',  'SI',
                                          'DLE', 'DC1', 'DC2', 'DC3',
                                          'DC4', 'NAK', 'SYN', 'ETB',
                                          'CAN', 'EM',  'SUB', 'ESC',
                                          'FS',  'GS',  'RS',  'US');
{$ENDIF}

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure Register;
begin
    RegisterComponents('FPiette', [TTnScript]);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
constructor TTnScript.Create(AOwner : TComponent);
begin
    inherited Create(AOwner);
    FEventList := TList.Create;
    SetInputBufferSize(80);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
destructor TTnScript.Destroy;
begin
    if Assigned(FEventList) then begin
        FEventList.Free;
        FEventList := nil;
    end;
    if FInputBuffer <> nil then begin
        FreeMem(FInputBuffer, FInputBufferSize);
        FInputBuffer := nil;
    end;
    inherited Destroy;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Set the input buffer size. This will clear any data already in the buffer }
procedure TTnScript.SetInputBufferSize(newSize : Integer);
begin
    { Round the size to the nearest upper 16 bytes limit }
    newSize := ((newSize shr 4) + 1) shl 4;

    { If no change, do nothing }
    if FInputBufferSize = newSize then
        Exit;

    { If buffer already allocated, free it }
    if FInputBuffer <> nil then begin
        FreeMem(FInputBuffer, FInputBufferSize);
        FInputBuffer := nil;
    end;

    { Allocate a new buffer of the given size }
    FInputBufferSize := newSize;
    GetMem(FInputBuffer, FInputBufferSize);

    { Clear the markers }
    FInputBufferStart := 0;
    FInputBufferCount := 0;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnScript.TriggerDisplay(Msg : String);
begin
    if Assigned(FOnDisplay) then
        FOnDisplay(Self, Msg);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TTnScript.TriggerStringMatch(ID : Integer);
begin
    if Assigned(FOnStringMatch) then
        FOnStringMatch(Self, ID);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TTnScript.SearchEvent(ID : Integer) : Integer;
begin
    if Assigned(FEventList) then begin
        for Result := 0 to FEventList.Count - 1 do begin
            if PEventDescriptor(FEventList.Items[Result])^.ID = ID then
                Exit;
        end;
    end;
    Result := -1;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Add an event (a string to search for) to the list                         }
procedure TTnScript.AddEvent(
    ID      : Integer;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情一区在线| 欧美成人激情免费网| 欧美韩国日本不卡| www.亚洲免费av| 亚洲人123区| 欧美酷刑日本凌虐凌虐| 毛片一区二区三区| 精品国产123| 高清在线成人网| 亚洲免费在线观看| 欧美剧情电影在线观看完整版免费励志电影 | 国产亚洲自拍一区| 不卡的av电影| 五月天精品一区二区三区| 欧美一区二区三区四区在线观看| 久久国产剧场电影| 国产精品美女久久久久av爽李琼| 色综合激情久久| 麻豆精品一区二区三区| 欧美精彩视频一区二区三区| 欧美影院午夜播放| 久久国产生活片100| 国产精品传媒视频| 日韩无一区二区| 国产精品一区二区黑丝| 亚洲国产精品影院| 精品国产一区二区亚洲人成毛片| 不卡一区中文字幕| 蜜臀va亚洲va欧美va天堂| 亚洲国产经典视频| 91精品国产一区二区| 在线日韩一区二区| 男女男精品视频网| 国产精品国产成人国产三级| 欧美一卡2卡三卡4卡5免费| 成人久久18免费网站麻豆| 日本亚洲一区二区| 中文字幕佐山爱一区二区免费| 51精品国自产在线| 91老师片黄在线观看| 久久精品国产久精国产爱| 亚洲人成精品久久久久| 精品1区2区在线观看| 欧美亚洲免费在线一区| 成人性生交大片免费看中文网站| 午夜精品免费在线| 亚洲欧美日韩国产一区二区三区| 精品成人a区在线观看| 欧美人xxxx| 91视频免费看| 成人免费毛片高清视频| 九一久久久久久| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲国产精品高清| 久久久综合激的五月天| 欧美一区午夜精品| 欧美日韩一区视频| 91在线视频播放地址| 国产超碰在线一区| 激情伊人五月天久久综合| 五月激情综合网| 亚洲成人动漫精品| 一区二区三区丝袜| 亚洲青青青在线视频| 国产精品久久久久久久第一福利 | 日韩欧美国产一区在线观看| 色婷婷精品久久二区二区蜜臀av| 国产激情视频一区二区三区欧美 | 亚洲午夜电影网| 成人欧美一区二区三区白人| 国产欧美一区二区精品性| 欧美白人最猛性xxxxx69交| 欧美一区永久视频免费观看| 欧美乱熟臀69xxxxxx| 欧美精品在线视频| 欧美精品久久天天躁| 91麻豆精品国产自产在线| 欧美亚洲丝袜传媒另类| 欧美午夜精品久久久| 欧美在线制服丝袜| 欧美日韩一级黄| 欧美人体做爰大胆视频| 91精品国产综合久久婷婷香蕉 | 亚洲精品免费一二三区| 国产传媒久久文化传媒| 国产一区二区调教| 国产suv精品一区二区三区| 国产iv一区二区三区| 成人性生交大片免费看在线播放| 成人97人人超碰人人99| 91猫先生在线| 欧美日韩国产精品自在自线| 日韩欧美一区二区免费| 久久综合狠狠综合久久激情| 久久色成人在线| 国产精品成人在线观看| 一区二区三区免费看视频| 午夜电影网亚洲视频| 免费一区二区视频| 国产成人免费视频网站| 91蜜桃视频在线| 正在播放亚洲一区| 国产日产欧美一区二区三区| 亚洲精品中文在线影院| 日本午夜精品一区二区三区电影| 国内成人精品2018免费看| 成人高清视频免费观看| 欧美日韩在线精品一区二区三区激情| 欧美日韩成人激情| 久久久99精品免费观看不卡| 亚洲欧美电影院| 免费观看久久久4p| 91在线视频免费观看| 日韩一区国产二区欧美三区| 中文字幕乱码亚洲精品一区| 午夜伊人狠狠久久| 国产成a人亚洲精品| 欧美色倩网站大全免费| 久久久久9999亚洲精品| 亚洲午夜久久久| 成人午夜电影网站| 91麻豆精品国产91| 亚洲私人影院在线观看| 国内外成人在线| 欧美三区免费完整视频在线观看| 欧美精品一区二区三区在线播放 | 日本一区二区三区四区| 亚洲福利电影网| 成人av午夜电影| 日韩一级成人av| 一区二区三区四区乱视频| 国产激情一区二区三区四区| 7777精品久久久大香线蕉| 亚洲啪啪综合av一区二区三区| 精品在线播放免费| 欧美精品在线视频| 亚洲精品老司机| 成人av综合一区| 久久综合给合久久狠狠狠97色69| 亚洲午夜一区二区三区| 丁香一区二区三区| 久久网站热最新地址| 免费成人在线视频观看| 欧美亚一区二区| 18欧美乱大交hd1984| 国产成人精品一区二| 欧美成人三级在线| 日韩精品91亚洲二区在线观看 | 爽好久久久欧美精品| 97精品久久久久中文字幕| 国产日本欧洲亚洲| 国产精品亚洲综合一区在线观看| 日韩三级中文字幕| 天堂va蜜桃一区二区三区漫画版 | 不卡一区在线观看| 国产视频一区在线播放| 国产精品一区免费在线观看| 日韩精品一区二区三区在线| 日本sm残虐另类| 欧美一区二区三区不卡| 日韩经典中文字幕一区| 91麻豆精品国产91久久久久| 天天色综合天天| 91精品婷婷国产综合久久性色 | 国产一区二区三区在线观看免费| 欧美一区二区三区免费观看视频| 日韩精品欧美成人高清一区二区| 欧美伊人精品成人久久综合97 | 91精品国产91久久久久久一区二区| 亚洲综合激情另类小说区| 在线欧美日韩国产| 亚洲成人av中文| 91精品国产综合久久久久久久| 日韩成人午夜电影| 欧美成人一区二区三区片免费 | 日韩中文字幕一区二区三区| 欧美精品乱码久久久久久| 青娱乐精品在线视频| 精品久久久久久最新网址| 国产福利精品一区二区| 中文字幕中文字幕一区二区| 91久久一区二区| 午夜精品久久久久久久蜜桃app | 色婷婷国产精品久久包臀| 一区二区三区**美女毛片| 欧美视频完全免费看| 免费亚洲电影在线| 久久久精品国产免费观看同学| 成人av片在线观看| 亚洲黄色性网站| 91精品国产综合久久精品麻豆 | 欧美一区二视频| 韩国理伦片一区二区三区在线播放| 久久精品亚洲精品国产欧美 | 555www色欧美视频| 激情五月婷婷综合| 中文字幕在线观看不卡视频| 欧美日韩久久一区二区| 国产精品资源在线看| 一区二区成人在线|