StartThreads() public method

public StartThreads ( int count ) : void
count int
return void
コード例 #1
0
        private string BuildRequests(string function, DataBaseType db)
        {
            if (_internalData.UseConditions)
             {
            _extractingInfos.Status.Add("Start asynchron requests");
            _requestList.Clear();
            _lastQueryOutput = string.Empty;

            _reqManager = new RequestManager
                             {
                                CustomCookieCollection = _injectInfos.CustomCookieCollection
                             };
            _reqManager.RequestFinished += ReqManagerRequestFinished;
            _reqManager.StartThreads(4);
            BuildRequestsCharacter(function, db, 1);

            _requestsComplete = new ManualResetEvent(false);
            var wh = new WaitHandle[] { _requestsComplete };
            WaitHandle.WaitAny(wh, -1, false);
            _extractingInfos.Status.Add("Asynchron requests complete");
            return _lastQueryOutput;
             }

             _requestConstructor.InsertQuery(_injector.InjectUnionQuery(function));
             string html = SendWebrequest(_requestConstructor.GetURL(), _requestConstructor.GetPOST());
             int indexBegin = html.IndexOf("___ll");
             if (indexBegin == -1)
            return string.Empty;
             html = html.Remove(0, indexBegin + 5);

             int indexEnd = html.IndexOf("ll___");
             if (indexEnd == -1)
            return string.Empty;
             html = html.Remove(indexEnd);

             return html;
        }