Ejemplo n.º 1
0
        private async void batchButton_Click(object sender, EventArgs e)
        {
            int numOfDomains = Convert.ToInt32(numOfDomainsTxtBox.Text);
            var domains      = DomainLists.moztop();
            int domainscount = domains.Count();

            if (numOfDomains > domainscount)
            {
                numOfDomains = domainscount;
            }

            Console.WriteLine("num of domains is now" + numOfDomains.ToString());

            batchProgressBar.Minimum = 0;
            batchProgressBar.Maximum = numOfDomains;
            batchProgressBar.Value   = 0;

            for (int c = 0; c <= numOfDomains - 1; c++)
            {
                ListViewItem      list          = new ListViewItem();
                pingAsyncResponse aSYNCping     = new pingAsyncResponse();
                string            currentDomain = domains[c];
                string[]          result        = await aSYNCping.info(currentDomain);


                list.Text = currentDomain;
                for (int count = 1; count <= 5; count++)
                {
                    list.SubItems.Add(result[count]);
                }
                dataViewList.Items.Add(list);
                try
                {
                    batchProgressBar.Value = batchProgressBar.Value + 1;
                }
                catch
                {
                    batchProgressBar.Value = batchProgressBar.Maximum;
                }
            }
            batchProgressBar.Value = numOfDomains;
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var domains = DomainLists.moztop();

            Console.WriteLine(domains.Count());
        }