How can i sum the total of links in real time while its processing?
<p>I have this code its a function that calling it self all the time.
Im using backgroundworker and in the backgroundworker Dowork event i call the function first time with a button click to start the process.</p>

<p>In this function i have two placesi m using label 12 and label 10 Text property.
Label 12 present bad links and Label 10 present good links. Bot are working in real time the text is changing in real time.</p>

<p>Where in this function i can use the label 3 Text to sum both label 12 + label 10 and present the total of links ?</p>

<p>Like this: </p>

<pre><code>this.Invoke(new MethodInvoker(delegate { label3.Text = label12 + label10 }));
</code></pre>

<p>The questions are :</p>

<ol>
<li><p>How do i do the sum of label12 and label10 so label3 will present a number int ?</p></li>
<li><p>Where should i put this label3.Text line in the function ?</p></li>
</ol>

<p>This is the code:</p>

<pre><code>private List&lt;string&gt; test(string url, int levels,DoWorkEventArgs eve)
        {


            HtmlWeb hw = new HtmlWeb();
            List&lt;string&gt; webSites;
            List&lt;string&gt; csFiles = new List&lt;string&gt;();

            csFiles.Add("temp string to know that something is happening in level = " + levels.ToString());
            csFiles.Add("current site name in this level is : " + url);
            try
            {
                this.Invoke(new MethodInvoker(delegate { Texts(richTextBox1, "Loading The Url:   " , Color.Red); }));
                this.Invoke(new MethodInvoker(delegate { Texts(richTextBox1, url + "...",Color.Blue); }));
                HtmlAgilityPack.HtmlDocument doc = TimeOut.getHtmlDocumentWebClient(url, false, "", 0, "", "");

                this.Invoke(new MethodInvoker(delegate { Texts(richTextBox1, " Done " + Environment.NewLine, Color.Red); }));


                    currentCrawlingSite.Add(url);
                    webSites = getLinks(doc);
                    removeDupes(webSites);
                    removeDuplicates(webSites, currentCrawlingSite);
                    removeDuplicates(webSites, sitesToCrawl);
                    if (removeExt == true)
                    {
                        removeExternals(webSites);
                    }
                    if (downLoadImages == true)
                    {
                        webContent.retrieveImages(url);                    }
                    if (levels &gt; 0)
                        sitesToCrawl.AddRange(webSites
                    this.Invoke(new MethodInvoker(delegate { label7.Text = sitesToCrawl.Count.ToString(); }));
                    this.Invoke(new MethodInvoker(delegate { label12.Text = currentCrawlingSite.Count.ToString(); }));


                    if (levels == 0)
                    {
                        return csFiles;
                    }
                    else
                    {


for (int i = 0; i &lt; webSites.Count(); i++)//&amp;&amp; i &lt; 20; i++)                         
                        { 


                            string t = webSites[i];
                            if ((t.StartsWith("http://") == true) || (t.StartsWith("https://") == true)) // replace this with future FilterJunkLinks function
                            {
                                csFiles.AddRange(test(t, levels - 1, eve));                                
                            }

                        }
                        return csFiles;
                    }



            }
            catch
            {
                failedUrls++;
                this.Invoke(new MethodInvoker(delegate { label10.Text = failedUrls.ToString(); }));
                this.Invoke(new MethodInvoker(delegate { Texts(richTextBox1, " Failed " + Environment.NewLine, Color.Green); }));
                return csFiles;
            }

        }
</code></pre>
