Beispiel #1
0
    public void SetFlagBy(string key, bool t)
    {
        bool exists = false;

        for (int i = 0; i < flags.Length; i++)
        {
            if (flags[i].m_FlagName.Equals(key))
            {
//				Debug.Log( "Set Flag:" + key + "=true" );
                flags[i].m_IsFlagOn = t;
                exists = true;
                break;
            }
        }

        // Create the Flag Unit  If not exists the flag  .
        if (!exists)
        {
            List <FlagUnit> flagList = new List <FlagUnit>();
            for (int i = 0; i < flags.Length; i++)
            {
                flagList.Add(flags[i]);
            }

            FlagUnit unit = new FlagUnit();
            unit.m_FlagName = key;
            unit.m_IsFlagOn = t;
            flagList.Add(unit);
            flags = flagList.ToArray();
        }
    }
Beispiel #2
0
    ////////////////////////////////////////////////////////////////////////////

    public void ClearFlags()
    {
        flags               = new FlagTable.FlagUnit[1];
        flags[0]            = new FlagUnit();
        flags[0].m_FlagName = "";
    }
 private void Tmr_Tick(object sender, EventArgs e)
 {
     tmr.Stop();
     wb.Stop();
     FlagUnit item = new FlagUnit(wb.Tag.ToString(), -1, "", "", "", "");
     item.Status = "Not Working - Timeout";
     _data.Add(item);
     gridControlMain.RefreshDataSource();
     if (QueProxy.Count == 0)
     {
         btnStartTest.Enabled = true;
         return;
     }
     else
         ExeTest();
 }
        private void Wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            tmr.Stop();
            WebBrowser webbro = (WebBrowser)sender;
            FlagUnit item = new FlagUnit(webbro.Tag.ToString(), -1, "", "", "", "");
            if (webbro.DocumentText.Contains(MSG_OK))
            {
                item.Status = "Working";
                try { adp.InsertNewProxy(item.Proxy); } catch {}
            }
            else
            {
                item.Status = "Not Working";
            }
            _data.Add(item);
            gridControlMain.RefreshDataSource();

            string[] Cookies = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
            foreach (string CookieFile in Cookies)
            {
                try { System.IO.File.Delete(CookieFile); } catch { }
            }
            if (wb.Document.Cookie != null)
            {
                wb.Document.Cookie.Remove(0, wb.Document.Cookie.Length);
                wb.Document.Cookie = string.Empty;
            }

            if (QueProxy.Count == 0)
            {
                btnStartTest.Enabled = true;
                return;
            }
            else
                ExeTest();
        }