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

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

?? httpthr1.pas

?? 包含常用Internet協議TCP,UDP、HTTP、FTP、Telnet等
?? PAS
字號:
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Author:       Fran鏾is PIETTE (From a work done by Ed Hochman <ed@mbhsys.com>)
Creation:     Jan 13, 1998
Version:      1.00
Description:  HttpThrd is a demo program showing how to use THttpCli component
              in a multi-threaded program.
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) 1997, 1998 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:

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
unit HttpThr1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  HttpProt, StdCtrls, IniFiles;


type
  TThreadState = (tsInexistant, tsReady, tsInUse);

  THttpThreadForm = class(TForm)
    URLEdit: TEdit;
    ResultsMemo: TMemo;
    DoItButton: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Thread0Label: TLabel;
    Thread1Label: TLabel;
    Thread2Label: TLabel;
    Thread3Label: TLabel;
    Thread4Label: TLabel;
    Thread5Label: TLabel;
    ProgressListBox: TListBox;
    Label14: TLabel;
    ProxyEdit: TEdit;
    Label15: TLabel;
    procedure DoItButtonClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    FInitialized : Boolean;
    FIniFileName : String;
    procedure CreateThread(Sender: TObject);
    procedure SetThreadState(Which : Integer; State: TThreadState);
  public
    procedure ProcessResults(ThreadNumber: Integer; Success : Boolean);
  end;

const
    SectionData   = 'Data';
    KeyURL        = 'URL';
    KeyProxy      = 'Proxy';
    SectionWindow = 'Window';
    KeyTop        = 'Top';
    KeyLeft       = 'Left';
    KeyWidth      = 'Width';
    KeyHeight     = 'Height';

var
    HttpThreadForm: THttpThreadForm;

implementation

{$R *.DFM}

uses
    HttpThr2;             // The thread class is defined there
const
    MaxThreads    = 6;    // If you change this, change labels on the form
var
    // The array with all our threads components
    ThreadsObjects : array [0..MaxThreads - 1] of THTTPThread;
    // The array with all thread states
    ThreadsState   : array [0..MaxThreads - 1] of TThreadState;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormCreate(Sender: TObject);
var
    i: Integer;
begin
    FIniFileName := LowerCase(ExtractFileName(Application.ExeName));
    FIniFileName := Copy(FIniFileName, 1, Length(FIniFileName) - 3) + 'ini';
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do
        SetThreadState(i, tsInexistant);  //Not created.
    ResultsMemo.Clear;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormShow(Sender: TObject);
var
    IniFile : TIniFile;
begin
    if not FInitialized then begin
        FInitialized   := TRUE;
        IniFile        := TIniFile.Create(FIniFileName);
        URLEdit.Text   := IniFile.ReadString(SectionData, KeyURL,
                                             'http://www.rtfm.be/fpiette');
        ProxyEdit.Text := IniFile.ReadString(SectionData, KeyProxy, '');
        Top            := IniFile.ReadInteger(SectionWindow, KeyTop,    Top);
        Left           := IniFile.ReadInteger(SectionWindow, KeyLeft,   Left);
        Width          := IniFile.ReadInteger(SectionWindow, KeyWidth,  Width);
        Height         := IniFile.ReadInteger(SectionWindow, KeyHeight, Height);

        IniFile.Free;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
var
    IniFile : TIniFile;
begin
    IniFile := TIniFile.Create(FIniFileName);
    IniFile.WriteString(SectionData, KeyURL,       URLEdit.Text);
    IniFile.WriteString(SectionData, KeyProxy,     proxyEdit.Text);
    IniFile.WriteInteger(SectionWindow, KeyTop,    Top);
    IniFile.WriteInteger(SectionWindow, KeyLeft,   Left);
    IniFile.WriteInteger(SectionWindow, KeyWidth,  Width);
    IniFile.WriteInteger(SectionWindow, KeyHeight, Height);
    IniFile.Free;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.DoItButtonClick(Sender: TObject);
var
    i: Integer;
begin
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do begin
        if ThreadsState[i] = tsInexistant then  //Thread has not been created yet
            CreateThread(Self);

        if ThreadsState[i] = tsReady then begin  //Thread is ready for use
            with ThreadsObjects[i] do begin
                FURL     := UrlEdit.Text;
                FProxy   := ProxyEdit.Text;
                SetThreadState(i, tsInUse);   // In use
                Resume;  //get the page
                Exit;    //For now, only start one thread for each click of DoIt
            end;
        end;
    end;
    MessageBeep(MB_OK);
    ShowMessage('No more threads available');
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.CreateThread(Sender: TObject);
var
    i: Integer;
begin
    for i := Low(ThreadsObjects) to High(ThreadsObjects) do begin
        if ThreadsObjects[i] = nil then begin
            ThreadsObjects[i] := THTTPThread.Create(True);
            ThreadsObjects[i].Setup(i);   //Create the HTTP object
            SetThreadState(i, tsReady);
            Exit;  //Found and activated an unused thread
        end;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure THttpThreadForm.SetThreadState(Which : Integer; State: TThreadState);
begin
    ThreadsState[Which] := State;
    case which of
        0: Thread0Label.Caption := IntToStr(Ord(State));
        1: Thread1Label.Caption := IntToStr(Ord(State));
        2: Thread2Label.Caption := IntToStr(Ord(State));
        3: Thread3Label.Caption := IntToStr(Ord(State));
        4: Thread4Label.Caption := IntToStr(Ord(State));
        5: Thread5Label.Caption := IntToStr(Ord(State));
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure LoadMemoFromMemoryStream(Memo : TMemo; Stream : TMemoryStream);
var
    p, q, r : PChar;
begin
    p := Stream.Memory;
    q := p + Stream.Size - 1;
    r := p;
    while (p <> nil) and (p < q) do begin
        while (p < q) and (p^<> #13) do
            Inc(p);
        Memo.Lines.Add(Copy(StrPas(r), 1, p - r));
        if (p[0] = #13) and (p[1] = #10) then
           Inc(p, 2)
        else
           Inc(p);
        r := p;
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
// To be called by each thread as it completes (using Synchronize !)
procedure THttpThreadForm.ProcessResults
   (ThreadNumber: Integer; Success : Boolean);
var
    Stream : TMemoryStream;
begin
    ThreadsObjects[ThreadNumber].Suspend;
    if Success then begin
        ResultsMemo.Lines.Add('* * * * * * THREAD ' +
                        IntToStr(ThreadNumber) + ' * * * * * *');
        Stream := ThreadsObjects[ThreadNumber].FHttpCli.RcvdStream
                  as TMemoryStream;
        LoadMemoFromMemoryStream(ResultsMemo, Stream);
        ResultsMemo.Lines.Add('');
    end
    else begin
        // There was an error getting data.
        ResultsMemo.Lines.Add('Nothing returned by thread: ' +
                              IntToStr(ThreadNumber));
    end;
    ResultsMemo.Lines.Add('* * * * * * * * * * * * * * * * * * * *');
    SetThreadState(ThreadNumber, tsReady);
    //Waiting for something to do (get next url here)
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最新热久久免费视频| 亚洲自拍都市欧美小说| 色94色欧美sute亚洲13| 日本不卡123| 亚洲精品大片www| 久久久三级国产网站| 91精品一区二区三区在线观看| 国产ts人妖一区二区| 美日韩一区二区三区| 樱花影视一区二区| 国产精品丝袜一区| 久久一区二区三区国产精品| 欧美人xxxx| 在线观看精品一区| 99久久99久久精品国产片果冻| 久久se这里有精品| 日韩国产高清在线| 亚洲小说欧美激情另类| 亚洲婷婷在线视频| 国产精品你懂的| 久久久久久影视| 精品久久五月天| 91精品国产欧美一区二区| 欧美午夜精品久久久久久超碰| 成人av网址在线观看| 国产露脸91国语对白| 国产原创一区二区| 经典三级在线一区| 免费观看一级欧美片| 日韩av电影免费观看高清完整版| 亚洲一区二区三区免费视频| 亚洲精品国久久99热| 亚洲卡通欧美制服中文| 亚洲视频在线一区观看| 亚洲视频在线一区二区| 国产精品欧美一区喷水| 国产欧美日韩麻豆91| 久久久99精品免费观看| 久久天堂av综合合色蜜桃网| 日韩一区二区三区在线观看| 欧美一级片在线观看| 欧美一级高清片| 精品日产卡一卡二卡麻豆| 日韩欧美资源站| 2023国产精华国产精品| 久久网站最新地址| 国产视频视频一区| 中文字幕欧美一| 亚洲伦理在线免费看| 亚洲一卡二卡三卡四卡无卡久久| 亚洲午夜久久久久中文字幕久| 午夜国产不卡在线观看视频| 婷婷成人综合网| 久久精品国产99久久6| 开心九九激情九九欧美日韩精美视频电影 | 中文字幕亚洲综合久久菠萝蜜| 国产精品色呦呦| 日韩一区日韩二区| 亚洲国产你懂的| 久久se精品一区二区| 国产成人av一区二区| 92国产精品观看| 欧美高清hd18日本| www成人在线观看| |精品福利一区二区三区| 亚洲成人www| 国产麻豆一精品一av一免费 | 91美女蜜桃在线| 欧美日韩国产大片| 久久嫩草精品久久久精品| 成人欧美一区二区三区| 天堂蜜桃91精品| 国产成人精品一区二区三区网站观看| www.色综合.com| 91精品在线观看入口| 国产午夜亚洲精品理论片色戒| 亚洲欧美一区二区三区久本道91| 日韩精品91亚洲二区在线观看 | 精品系列免费在线观看| 91亚洲男人天堂| 欧美一级欧美一级在线播放| 国产精品三级电影| 无码av中文一区二区三区桃花岛| 国产露脸91国语对白| 欧美日韩一区二区电影| 久久久国产精品麻豆| 五月婷婷久久丁香| 成人免费的视频| 欧美一区二区精美| 亚洲老妇xxxxxx| 韩国欧美国产一区| 欧美日本在线视频| 国产精品久久久久永久免费观看| 日韩国产欧美在线观看| 91丨porny丨户外露出| 欧美电影免费观看高清完整版在| 亚洲精品国产一区二区三区四区在线 | 一区二区三区免费网站| 国产一区在线视频| 欧美高清激情brazzers| 中文字幕亚洲欧美在线不卡| 久久疯狂做爰流白浆xx| 欧美亚洲一区二区在线| 亚洲国产成人一区二区三区| 麻豆高清免费国产一区| 在线这里只有精品| 中文字幕欧美国产| 国产中文一区二区三区| 91精品午夜视频| 一区二区三区av电影| 成人h动漫精品| 久久久久久综合| 经典三级一区二区| 欧美一级久久久| 石原莉奈在线亚洲三区| 欧美天堂亚洲电影院在线播放| 国产精品久久久久久久久免费丝袜| 精品无人区卡一卡二卡三乱码免费卡| 欧美日韩高清在线| 亚洲国产精品久久人人爱| 一本到一区二区三区| 亚洲三级在线免费观看| 成人的网站免费观看| 国产婷婷一区二区| 国产激情一区二区三区| 久久嫩草精品久久久精品| 黄色成人免费在线| 精品国产污网站| 久久成人18免费观看| 精品处破学生在线二十三| 麻豆一区二区三区| 欧美成人精精品一区二区频| 蜜桃久久久久久| 日韩免费视频线观看| 蜜桃一区二区三区在线观看| 日韩欧美一区二区在线视频| 久久精品国产亚洲一区二区三区| 91精品国产免费| 美腿丝袜亚洲综合| 久久噜噜亚洲综合| 懂色av一区二区三区免费看| 日本一区二区三区高清不卡| 成人精品小蝌蚪| 亚洲欧美综合另类在线卡通| 91国偷自产一区二区开放时间| 亚洲在线视频免费观看| 欧美日韩高清一区二区| 日韩精品欧美精品| 久久综合久色欧美综合狠狠| 国产一区在线观看麻豆| 国产精品久久久久久久久动漫| 95精品视频在线| 天天综合色天天综合| 精品久久久久久无| 成人免费毛片片v| 一区二区三区久久| 91精品蜜臀在线一区尤物| 久久成人精品无人区| 国产欧美1区2区3区| 色综合天天综合给合国产| 亚洲午夜电影在线观看| 91精品国产综合久久久久| 国精品**一区二区三区在线蜜桃| 国产三级三级三级精品8ⅰ区| 99视频在线精品| 亚洲aaa精品| 久久精品水蜜桃av综合天堂| 成人精品小蝌蚪| 亚洲aaa精品| 久久久精品欧美丰满| 91色在线porny| 美女视频黄 久久| 国产精品久久久一区麻豆最新章节| 在线观看av一区| 韩国女主播一区二区三区| 亚洲欧洲韩国日本视频| 8x福利精品第一导航| 成人免费毛片app| 日韩黄色免费电影| 中文字幕一区日韩精品欧美| 欧美一区二区三区小说| 99免费精品在线| 久久狠狠亚洲综合| 亚洲最大成人综合| 欧美mv日韩mv国产网站| 欧美午夜电影网| 懂色av一区二区三区免费看| 日韩av高清在线观看| 亚洲色图一区二区| 亚洲精品一区在线观看| 欧美影片第一页| 国产ts人妖一区二区| 青青草成人在线观看| 亚洲精品一卡二卡| 2020国产成人综合网| 在线成人免费观看| 99久久精品免费看国产免费软件| 另类小说综合欧美亚洲| 国产麻豆精品久久一二三| 午夜电影一区二区三区|