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

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

?? tnsrv2.pas

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

Author:       Fran鏾is PIETTE
Description:  TnSrv implement a (very basic) Telnet server (daemon)
              Compatible with both Delphi 1 and Delphi 2
              Uses TWSocket to communicate with WinSock
Creation:     April 1996
EMail:        francois.piette@pophost.eunet.be    francois.piette@rtfm.be
              http://www.rtfm.be/fpiette
Support:      Use the mailing list twsocket@rtfm.be See website for details.
Legal issues: Copyright (C) 1996, 1997, 1998, 1999 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.
Updates:
Sep 18, 1996 Accept CR/LF or LF only as line terminator
             Implement Help and Exit commands as demo
Mar 19, 1997 Use enhanced TWsocket object
Oct 03, 1997 V1.22 Added a $DEFINE POP3 to simulate a POP3 server
Oct 09, 1997 Added a $DEFINE SMTP to simulate a SMTP server
Oct 11, 1997 Added PortNum to specify which port we serve
             Added pseudo POP3 and SMTP interpreters (nothing really happens
             except transmission of pseudo correct answers. I use this
             feature to debug SMTP and POP3 components).
Jul 30, 1998 V1.24 Added some code to the dummy SMTP server


 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit Tnsrv2;


interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, WSocket, Winsock;

const
  SMTP_PORT = 25;
  POP3_PORT = 110;

  { The message WM_DISCONNECT is used by the client form to tell the server }
  { form that the client has disconnected or should be disconnected.        }
  WM_DISCONNECT     = WM_USER + 2;
  DISCONNECT_SELF   = 1;          { Client form ask to disconnect           }
  DISCONNECT_REMOTE = 2;          { Client user (remote) has disconnected   }

type
  { A new TClientForm will be instanciated for each new client connection. }
  { Instanciation is done from TClient constructor.                        }
  TClientForm = class(TForm)
    Memo: TMemo;
    DisconnectButton: TButton;
    DataEdit: TEdit;
    SendButton: TButton;
    Socket: TWSocket;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Display(Msg : String);
    procedure FormDestroy(Sender: TObject);
    procedure DisconnectButtonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure SendButtonClick(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure SocketDataAvailable(Sender: TObject; Error: Word);
    procedure SocketSessionClosed(Sender: TObject; Error: Word);
    procedure Button1Click(Sender: TObject);
  private
    FCommand  : String;
    FRcvdCR   : Boolean;
    FDataFlag : Boolean;
    procedure ProcessChar(Ch : Char);
    procedure CommandInterpreter;
    procedure SMTP_Interpreter(CommandVerb : String; CommandTail : String);
    procedure POP3_Interpreter(CommandVerb : String; CommandTail : String);
    procedure TELNET_Interpreter(CommandVerb : String; CommandTail : String);
  public
    AcceptForm : TForm;
    Reference  : Pointer;
    PortNum    : Integer;
  end;

var
  ClientForm: TClientForm;

implementation

{$R *.DFM}

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{$IFNDEF WIN32}
procedure SetLength(var Str : String; Len : Integer);
begin
    Str[0] := chr(Len);
end;


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


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function atoi(value : string) : Integer;
var
    i : Integer;
begin
    Result := 0;
    i := 1;
    while (i <= Length(Value)) and (Value[i] = ' ') do
        i := i + 1;
    while (i <= Length(Value)) and (Value[i] >= '0') and (Value[i] <= '9')do begin
        Result := Result * 10 + ord(Value[i]) - ord('0');
        i := i + 1;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TClientForm.FormCreate(Sender: TObject);
begin
    Memo.Clear;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ This procedure display text in a memo control.                            }
{ I should add code to remove lines when there are too much of them...      }
procedure TClientForm.Display(Msg : String);
var
    Start, Stop : Integer;
    SelStart : Integer;
begin
    if Memo.Lines.Count = 0 then
        Memo.Lines.Add('')
    else if Memo.Lines.Count > 200 then
        Memo.Clear;

    Start := 1;
    Stop  := Pos(#13, Msg);
    if Stop = 0 then
        Stop := Length(Msg) + 1;
    while Start <= Length(Msg) do begin
        Memo.Lines.Strings[Memo.Lines.Count - 1] := Memo.Lines.Strings[Memo.Lines.Count - 1] + Copy(Msg, Start, Stop - Start);
        if (Stop <= Length(Msg)) and (Msg[Stop] = #13) then begin
            SelStart := Memo.SelStart;
            Memo.Lines.Add('');
            Memo.SelStart := SelStart + 2;
        end;
        Start := Stop + 1;
        if Start > Length(Msg) then
            Break;
        if Msg[Start] = #10 then
           Start := Start + 1;
        Stop := Start;
        while (Stop <= Length(Msg)) and (Msg[Stop] <> #13) do
            Stop := Stop + 1;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Not a real SMTP command interpreter, just enough for me to test my SMTP   }
{ component.                                                                }
procedure TClientForm.SMTP_Interpreter(
    CommandVerb : String;
    CommandTail : String);
var
    Response    : String;
begin
    if FDataFlag then begin
        { We should add storage here of course...              }
        { SMTP data ends with a line having being a single dot }
        if FCommand = '.' then begin
            Response := '250 Data received ok';
            Socket.SendStr(Response + #13 + #10);
            FDataFlag := FALSE;
        end;
    end
    else begin
        FDataFlag := FALSE;
        if CommandVerb = 'MAIL' then
            Response := '250 Ok'
        else if CommandVerb = 'RCPT' then
            Response := '250 Ok'
        else if CommandVerb = 'DATA' then begin
            Response := '354 Send data now';
            FDataFlag := TRUE;
        end
        else if CommandVerb = 'HELO' then
            Response := '250 Ok'
        else if CommandVerb = 'QUIT' then
            Response := '221 Goodbye'
        else
            Response := '500 syntax error';

        Socket.SendStr(Response + #13 + #10);
        if CommandVerb = 'QUIT' then
            Socket.Close;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Not a real POP3 command interpreter, just enough for me to test my POP3   }
{ component.                                                                }
procedure TClientForm.POP3_Interpreter(
    CommandVerb : String;
    CommandTail : String);
var
    Response    : String;
begin
    if CommandVerb = 'USER' then
        Response := '+OK'
    else if CommandVerb = 'PASS' then
        Response := '+OK'
    else if CommandVerb = 'RETR' then begin
        Socket.SendStr('+OK' + #13 + #10);
        Socket.SendStr('This is the message body.' + #13 + #10);
        Socket.SendStr('This is the last message line.' + #13 + #10);
        Response := '.'
    end
    else if CommandVerb = 'LIST' then begin

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费高清| 91精品国产免费久久综合| 日本韩国欧美在线| 日韩免费看的电影| 亚洲另类一区二区| 国产精品综合一区二区三区| 在线亚洲+欧美+日本专区| 久久―日本道色综合久久| 亚洲国产精品综合小说图片区| 精品一区二区三区欧美| 色噜噜夜夜夜综合网| 26uuu精品一区二区三区四区在线| 亚洲一区二区三区视频在线| 成人午夜精品在线| 精品成人佐山爱一区二区| 亚洲v精品v日韩v欧美v专区| 91看片淫黄大片一级| 中文字幕精品综合| 国产一区二区三区四| 日韩欧美国产精品一区| 日韩精品亚洲专区| 欧美日韩一区二区三区视频| 亚洲欧美另类小说| 中文字幕欧美日韩一区| 国精产品一区一区三区mba桃花| 欧美三级视频在线观看| 亚洲夂夂婷婷色拍ww47| 色婷婷国产精品| 粉嫩久久99精品久久久久久夜| 日韩一区二区视频| 日韩电影免费在线看| 91精品久久久久久蜜臀| 日韩高清在线不卡| 欧美一区二区三区性视频| 午夜精品福利在线| 欧美美女黄视频| 亚洲福利视频导航| 欧美美女一区二区在线观看| 日韩制服丝袜av| 欧美一区国产二区| 六月丁香综合在线视频| 精品国产伦一区二区三区观看体验| 久久99精品久久久久久久久久久久| 日韩欧美一区二区视频| 韩国欧美一区二区| 久久久99精品免费观看| 国产成人自拍网| 国产欧美日韩麻豆91| 成人app网站| 一级精品视频在线观看宜春院| 欧美在线free| 丝袜国产日韩另类美女| 欧美成人r级一区二区三区| 国产一区二区不卡在线| 国产精品国模大尺度视频| 色欧美乱欧美15图片| 午夜精品久久久久久久久久| 日韩一级欧美一级| 成人免费黄色大片| 亚洲一区二区不卡免费| 日韩三级.com| 成人小视频免费观看| 亚洲一区二区三区小说| 日韩欧美一级在线播放| 成人黄色网址在线观看| 亚洲一区二区精品久久av| 精品乱人伦一区二区三区| av电影在线观看一区| 天天影视色香欲综合网老头| 久久综合久久综合久久综合| jlzzjlzz国产精品久久| 人人超碰91尤物精品国产| 日本一区二区三区dvd视频在线| 91福利视频久久久久| 国产精品自在在线| 亚洲成人自拍一区| 欧美激情一区二区三区| 欧美日韩久久一区| 粉嫩绯色av一区二区在线观看 | 欧美日韩精品福利| 国产九色精品成人porny | 蜜臀99久久精品久久久久久软件| 国产免费久久精品| 日韩一区二区在线播放| 色诱视频网站一区| 国产成人超碰人人澡人人澡| 午夜视频在线观看一区二区| 中文字幕亚洲在| 2020日本不卡一区二区视频| 欧亚洲嫩模精品一区三区| 丁香激情综合五月| 狠狠色狠狠色综合| 日韩电影在线一区二区| 夜夜亚洲天天久久| 最新国产成人在线观看| 日本一区二区三区免费乱视频| 欧美成人猛片aaaaaaa| 精品视频在线视频| 色国产综合视频| 97久久精品人人做人人爽| 国产精品一区二区久激情瑜伽| 日韩va亚洲va欧美va久久| 一区二区视频在线看| 26uuu亚洲| 欧美成人aa大片| 日韩一级二级三级| 日韩一级黄色大片| 精品国内片67194| 日韩精品一区二| 日韩精品中文字幕一区| 555夜色666亚洲国产免| 7777精品久久久大香线蕉| 欧美日韩精品一区二区| 欧美三级蜜桃2在线观看| 欧美性极品少妇| 欧美日韩一区二区在线视频| 欧美日本国产一区| 欧美精品在欧美一区二区少妇| 在线观看视频91| 欧美日韩一区精品| 91精品国产aⅴ一区二区| 欧美一级二级在线观看| 日韩欧美中文字幕制服| 欧美成人精品二区三区99精品| 日韩一区二区免费电影| 久久久一区二区| 中文欧美字幕免费| 亚洲丝袜另类动漫二区| 亚洲一区二区高清| 美女脱光内衣内裤视频久久网站| 蜜桃视频在线观看一区| 国产在线日韩欧美| www.66久久| 6080国产精品一区二区| 久久亚洲捆绑美女| ...xxx性欧美| 天堂在线一区二区| 国产精品538一区二区在线| 波多野结衣的一区二区三区| 亚洲乱码国产乱码精品精可以看 | 日韩不卡一区二区三区| 麻豆成人91精品二区三区| 国产成人综合亚洲网站| 97精品视频在线观看自产线路二| 在线免费观看日本一区| 日韩欧美一二区| 亚洲欧美成人一区二区三区| 午夜av电影一区| 国产成人日日夜夜| 欧美网站一区二区| 国产亚洲精品中文字幕| 亚洲一区免费视频| 国产成人午夜电影网| 在线看国产日韩| 久久久久久毛片| 亚洲午夜免费电影| 国产很黄免费观看久久| 欧美日韩国产一级| 中文字幕欧美日韩一区| 青娱乐精品在线视频| av一区二区三区| 欧美www视频| 亚洲最新在线观看| 懂色一区二区三区免费观看| 在线成人av影院| 亚洲欧洲国产专区| 精品无人码麻豆乱码1区2区 | 久久久精品免费观看| 亚洲国产一区二区三区| 成人一级黄色片| 制服.丝袜.亚洲.中文.综合| 亚洲婷婷在线视频| 国产一级精品在线| 日韩片之四级片| 午夜久久久久久久久| 99久久综合精品| 国产精品污污网站在线观看| 精品一区二区三区影院在线午夜| 欧美在线观看视频一区二区三区| 国产欧美一区二区在线观看| 美女一区二区在线观看| 欧美视频一区在线| 亚洲视频在线观看三级| 国产v综合v亚洲欧| 久久久久久影视| 久久疯狂做爰流白浆xx| 欧美日韩国产三级| 夜夜操天天操亚洲| 精品视频1区2区| 一级中文字幕一区二区| 91国偷自产一区二区开放时间| 国产精品成人在线观看| 成人午夜激情片| 国产精品毛片a∨一区二区三区| 日韩一级黄色大片| 久久婷婷综合激情| 韩国v欧美v日本v亚洲v| 日韩欧美精品在线视频| 麻豆精品精品国产自在97香蕉| 在线综合视频播放|