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

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

?? consrv1.dpr

?? 包含常用Internet協(xié)議TCP,UDP、HTTP、FTP、Telnet等
?? DPR
字號:
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Author:       Fran鏾is PIETTE
Description:  Demo for a full blown multi-user server using TWSocket and
              console mode.
EMail:        francois.piette@pophost.eunet.be    francois.piette@rtfm.be
              http://www.rtfm.be/fpiette
Creation:     Feb 17, 1999
Version:      1.01
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.

              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.

History:
Sep 29, 1999 V1.01 Adapted for Delphi 5

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
program ConSrv1;
{$IFDEF VER80}
  Bomb('Sorry but Delphi 1 doesn''t support console mode program');
{$ENDIF}
{$APPTYPE CONSOLE}
{$IFNDEF NOFORMS}
  Bomb('This demo must be compiled with symbol NOFORMS defined.' +
       'Go to Delphi/Menu/Project/Options and in "Directories/Conditionals"' +
       'tab, add NOFORMS to the "define" edit box.');
{$ENDIF}

uses
  Windows,
  SysUtils,
  Messages,
  Classes,
  WSocket,
  WinSock,
  ConSrv1S in 'ConSrv1S.pas',
  ConSrv1C in 'ConSrv1C.pas';

const
    Version = 101;

type
    TKeyboardThread = class (TThread)
    public
        procedure Execute; override;
    end;

// Declare all standard functions and procedures
function  InitAplication : Boolean; forward;
procedure RunAplication; forward;
procedure CleanupAplication; forward;
procedure CleanupData; forward;
function  CtrlHandlerRoutine(CtrlType : DWORD) : DWORD; stdcall; forward;
function  MyWindowProc(ahWnd   : HWND;
                       auMsg   : Integer;
                       awParam : WPARAM;
                       alParam : LPARAM): Integer; stdcall; forward;
function  CreateEvent(var MsgRec : TMsg) : Integer; forward;
procedure ClientDisconnectedEvent(var MsgRec : TMsg); forward;

// Declare some global variables
var
    SrvObject     : TServerObject;
    Terminated    : Boolean;
    hWndMain      : HWND;
    KbdThread     : TKeyboardThread;
    MyWindowClass : TWndClass = (style         : 0;
                                 lpfnWndProc   : @MyWindowProc;
                                 cbClsExtra    : 0;
                                 cbWndExtra    : 0;
                                 hInstance     : 0;
                                 hIcon         : 0;
                                 hCursor       : 0;
                                 hbrBackground : 0;
                                 lpszMenuName  : nil;
                                 lpszClassName : 'MyWindowClass');


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ Console mode applications do not receive keyboard messages as GUI apps.   }
{ We use a thread to wait for keyboard activity and generate keyboard       }
{ messages as in a GUI application.                                         }
procedure TKeyboardThread.Execute;
var
    hConsole    : THandle;
    Status      : DWORD;
    InputBuffer : TInputRecord;
    KeyEvent    : TKeyEventRecord;
    Count       : DWORD;
begin
    hConsole := GetStdHandle(STD_INPUT_HANDLE);
    while not Terminated do begin
        Status := WaitForSingleObject(hConsole, 1000);
        if Status = WAIT_OBJECT_0 then begin
            if ReadConsoleInput(hConsole, InputBuffer, 1, Count) then begin
                if InputBuffer.EventType = KEY_EVENT then begin
{$IFDEF VER90}  { Delphi 2 }
                    KeyEvent := InputBuffer.KeyEvent;
{$ELSE}
{$IFDEF VER93}  { Bcb 1    }
                    KeyEvent := InputBuffer.KeyEvent;
{$ELSE}
{$IFDEF VER100} { Delphi 3 }
                    KeyEvent := InputBuffer.KeyEvent;
{$ELSE}
{$IFDEF VER110} { Bcb 3    }
                    KeyEvent := InputBuffer.KeyEvent;
{$ELSE}
{$ENDIF}
{ Starting from Delphi 4 and Bcb4, they changed definition }
                    KeyEvent := InputBuffer.Event.KeyEvent;
{$ENDIF}
{$ENDIF}
{$ENDIF}
                    if KeyEvent.bKeyDown then begin
                        PostMessage(hWndMain, WM_KEYDOWN,
                                    KeyEvent.wVirtualKeyCode,
                                    KeyEvent.wRepeatCount +
                                    (KeyEvent.wVirtualScanCode shl 16));
                    end
                    else begin
                        PostMessage(hWndMain, WM_KEYUP,
                                    KeyEvent.wVirtualKeyCode,
                                    KeyEvent.wRepeatCount +
                                    (KeyEvent.wVirtualScanCode shl 16));
                    end;
                end;
            end;
        end;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{ This is a callback routine called by windows when some events occurs.     }
{ We trap those events to close our application.                            }
function CtrlHandlerRoutine(CtrlType : DWORD) : DWORD; stdcall;
begin
    case CtrlType of
    CTRL_C_EVENT,            // User hit CTRL-C
    CTRL_BREAK_EVENT,        // User hit CTRL-BREAK
    CTRL_LOGOFF_EVENT,       // User log off his session
    CTRL_CLOSE_EVENT,        // Close signal
    CTRL_SHUTDOWN_EVENT :    // Window shutdown signal
        begin
            Result := 1;
            PostMessage(hWndMain, WM_QUIT, 0, 0);
        end;
    else
        Result := 0;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure ClientDisconnectedEvent(var MsgRec : TMsg);
var
    Client : TClientObject;
begin
    Client := TClientObject(MsgRec.lParam);
    if Assigned(SrvObject) and Assigned(Client) then
        SrvObject.DisconnectedClient(Client);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function CreateEvent(var MsgRec : TMsg) : Integer;
begin
    try
        SetConsoleTitle(PChar('ConSrv V' + Format('%d.%2d',
                              [Version div 100,Version mod 100])));
        WriteLn('Hit CTRL-C to return to system.');
        SrvObject := TServerObject.Create;
        SrvObject.CtrlWindow := MsgRec.hwnd;
        KbdThread := TKeyboardThread.Create(FALSE);
        Result    := 0;  // Success
    except
        on E:Exception do begin
            WriteLn('CreateEvent failed.');
            WriteLn('Exception ' + E.ClassName + ': ' + E.Message);
            Result := -1; // Failure
        end;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure DisplayHelp;
begin
    WriteLn('F1      Display this help text');
    WriteLn('F2      Display user list');
    WriteLn('CTRL-C  Quit program');
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure KeyDownEvent(MsgRec : TMsg);
var
    Key : Integer;
begin
    Key := MsgRec.wParam;
    case Key of
    VK_SHIFT,
    VK_CONTROL,
    VK_MENU:     { Ignore };
    VK_F1:
        DisplayHelp;
    VK_F2:
        SrvObject.DisplayClientList;
    else
        MessageBeep(MB_OK);
        WriteLn('Unknown keyboard command. Type F1 to get help.');
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function MyWindowProc(
    ahWnd   : HWND;
    auMsg   : Integer;
    awParam : WPARAM;
    alParam : LPARAM): Integer; stdcall;
var
    MsgRec : TMsg;
begin
    Result := 0;  // This means we handled the message
    try
        MsgRec.hwnd    := ahWnd;
        MsgRec.message := auMsg;
        MsgRec.wParam  := awParam;
        MsgRec.lParam  := alParam;

        case auMsg of
        WM_CLIENT_DISCONNECTED:
            ClientDisconnectedEvent(MsgRec);
        WM_CREATE:
            Result := CreateEvent(MsgRec);
        WM_CLOSE:
            begin
                WriteLn('Closing');
                DestroyWindow(ahWnd);
            end;
        WM_DESTROY:
            begin
                WriteLn('Destroying');
                CleanupData;
            end;
        WM_KEYDOWN: KeyDownEvent(MsgRec);
{       WM_KEYUP:   writeln('WM_KEYUP'); }
{       WM_CHAR:    writeln('WM_CHAR');  }
        else
            Result := DefWindowProc(ahWnd, auMsg, awParam, alParam)
        end;
    except
        on E:Exception do
            WriteLn('Exception ' + E.ClassName + ': ' + E.Message);
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function InitAplication : Boolean;
begin
    Result := FALSE;
    if Windows.RegisterClass(MyWindowClass) = 0 then
        Exit;
    hWndMain := CreateWindowEx(WS_EX_TOOLWINDOW,
                               MyWindowClass.lpszClassName,
                               '',        { Window name   }
                               WS_POPUP,  { Window Style  }
                               0, 0,      { X, Y          }
                               0, 0,      { Width, Height }
                               0,         { hWndParent    }
                               0,         { hMenu         }
                               HInstance, { hInstance     }
                               nil);      { CreateParam   }
    if hWndMain = 0 then
        Exit;
    SetConsoleCtrlHandler(@CtrlHandlerRoutine, TRUE);
    Result := TRUE;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure CleanupData;
begin
    if Assigned(SrvObject) then begin
        SrvObject.Destroy;
        SrvObject := nil;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure CleanupAplication;
begin
    CleanupData;
    if hWndMain <> 0 then begin
        DestroyWindow(hWndMain);
        hWndMain := 0;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure RunAplication;
var
    MsgRec : TMsg;
begin
    { If GetMessage retrieves the WM_QUIT, the return value is FALSE and    }
    { the message loop is broken.                                           }
    while GetMessage(MsgRec, 0, 0, 0) do begin
        TranslateMessage(MsgRec);
        DispatchMessage(MsgRec)
    end;
    Terminated := TRUE;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
begin
    InitAplication;
    try
        RunAplication;
    finally
        CleanupAplication;
    end;
end.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性色黄大片| 久久久91精品国产一区二区三区| 欧美午夜影院一区| 亚洲精品国产高清久久伦理二区| 老司机免费视频一区二区| 99vv1com这只有精品| 2017欧美狠狠色| 日韩精品一卡二卡三卡四卡无卡| 97国产精品videossex| 亚洲精品乱码久久久久| 欧美日韩久久一区| 亚洲欧美日韩国产一区二区三区| 国产精品亚洲一区二区三区在线| 日韩一级二级三级精品视频| 亚洲一区二区四区蜜桃| 91视频一区二区三区| 欧美国产日韩亚洲一区| 激情丁香综合五月| 日韩欧美黄色影院| 裸体健美xxxx欧美裸体表演| 欧美日韩精品欧美日韩精品一综合| 天天操天天干天天综合网| 欧美日韩精品久久久| 激情小说亚洲一区| 综合自拍亚洲综合图不卡区| av亚洲精华国产精华精华| 国产嫩草影院久久久久| 成人福利视频网站| 亚洲国产成人在线| 欧美精品一卡二卡| 美女网站色91| 亚洲人成网站精品片在线观看| 91麻豆精品国产91久久久更新时间 | 老汉av免费一区二区三区| 中文字幕av资源一区| 91精品国产91久久久久久一区二区| 亚洲一区av在线| 久久精品综合网| 在线播放视频一区| 99国产精品久久久久| 精品一区二区三区在线观看| 久久亚洲免费视频| 欧美日韩国产不卡| 91香蕉视频污在线| 国产精品一区专区| 日本aⅴ亚洲精品中文乱码| 欧美一级二级在线观看| 欧亚一区二区三区| 日韩高清欧美激情| 久久麻豆一区二区| 91福利视频在线| 老汉av免费一区二区三区| 亚洲乱码国产乱码精品精的特点 | 欧美在线观看你懂的| 国产精品自拍一区| 免费人成黄页网站在线一区二区| 亚洲精选在线视频| 国产日产欧产精品推荐色| 日韩免费视频一区二区| 欧美日韩精品一区二区在线播放| 91视频在线观看| 91亚洲男人天堂| 成人高清在线视频| 国产 欧美在线| 亚洲自拍欧美精品| 玉米视频成人免费看| 1024成人网色www| 7777女厕盗摄久久久| 在线精品视频免费观看| 一本到高清视频免费精品| 美女网站视频久久| 免费高清成人在线| 日韩制服丝袜先锋影音| 亚洲高清免费一级二级三级| 国产亚洲精品7777| 中文字幕精品—区二区四季| 久久久精品免费观看| 久久色.com| 国产日韩成人精品| 国产欧美精品一区aⅴ影院 | |精品福利一区二区三区| 中文字幕av一区二区三区免费看| 欧美国产日韩精品免费观看| 国产精品护士白丝一区av| 欧美日韩和欧美的一区二区| 欧美影片第一页| 欧美三级日本三级少妇99| 不卡av在线网| 一道本成人在线| 欧美少妇bbb| 日韩一区二区中文字幕| 欧美videos中文字幕| 欧美日韩一区成人| 欧美一级国产精品| 精品国产乱码久久久久久久| 欧美人妖巨大在线| 在线播放日韩导航| 精品国产伦理网| 国产精品乱码一区二区三区软件| 91精品国产aⅴ一区二区| 久久综合九色综合久久久精品综合| 国产区在线观看成人精品| 136国产福利精品导航| 日韩精品欧美成人高清一区二区| 麻豆精品在线播放| 99麻豆久久久国产精品免费优播| 日本精品视频一区二区三区| 制服视频三区第一页精品| 久久一区二区三区四区| 亚洲欧洲www| 婷婷六月综合网| 懂色中文一区二区在线播放| 在线免费观看日本欧美| 精品国产免费久久| 亚洲影院久久精品| 国模冰冰炮一区二区| 99麻豆久久久国产精品免费优播| 欧美精品在欧美一区二区少妇| 欧美经典一区二区| 亚洲成人动漫在线免费观看| 午夜成人在线视频| 成人免费视频播放| 欧美色精品在线视频| 久久这里只有精品视频网| 一区二区三区免费看视频| 一区二区三区四区高清精品免费观看| 男女男精品视频| 91免费视频大全| 精品国产髙清在线看国产毛片| 亚洲欧美日韩国产综合| 国产激情一区二区三区四区 | 国产亚洲制服色| 亚洲狠狠爱一区二区三区| 国产一区二区0| 99久久er热在这里只有精品15| 日韩免费性生活视频播放| 亚洲一区二区精品视频| 丁香天五香天堂综合| 欧美一级xxx| 亚洲一区在线观看视频| 成人高清视频免费观看| 久久综合九色综合97婷婷女人| 亚洲国产成人va在线观看天堂| 国产91高潮流白浆在线麻豆| 日韩一区二区电影网| 亚洲一二三四在线观看| av电影在线观看一区| 久久久久国产精品免费免费搜索| 图片区小说区国产精品视频| 色噜噜狠狠色综合欧洲selulu| 欧美国产亚洲另类动漫| 国产精品18久久久久久久网站| 欧美一区二区三区性视频| 调教+趴+乳夹+国产+精品| 91精品福利视频| 一区二区三区日韩精品视频| 99久久久精品| 亚洲人成网站色在线观看| av亚洲精华国产精华精| 亚洲欧洲性图库| av在线这里只有精品| 成人免费一区二区三区视频| 懂色av一区二区三区蜜臀 | 久久精品人人做| 国产尤物一区二区| 精品成人在线观看| 另类的小说在线视频另类成人小视频在线 | 国产精品超碰97尤物18| 国产成a人亚洲精品| 中文字幕成人在线观看| 国产 日韩 欧美大片| 国产精品女上位| 成人免费电影视频| 中文字幕在线视频一区| 99久久免费国产| 亚洲国产欧美日韩另类综合| 欧美色国产精品| 美女一区二区久久| 久久天堂av综合合色蜜桃网| 高清在线不卡av| 亚洲色图在线视频| 在线观看亚洲成人| 日本在线不卡视频| 精品国产凹凸成av人网站| 国产大陆a不卡| 亚洲欧洲日韩女同| 在线不卡中文字幕播放| 美女国产一区二区三区| 中文字幕欧美三区| 欧美影院精品一区| 激情综合色播五月| 国产精品久久久久久久裸模| 欧美亚洲国产一区在线观看网站| 婷婷久久综合九色综合绿巨人| 日韩欧美中文字幕制服| 国产成人在线免费观看| 一区二区三区加勒比av| 日韩一区二区电影在线| 欧美日韩三级一区| 国产美女视频一区|