Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8654843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:53:09+00:00 2026-06-12T14:53:09+00:00

I have this code its a function that calling it self all the time.

  • 0

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.

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.

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

Like this:

this.Invoke(new MethodInvoker(delegate { label3.Text = label12 + label10 }));

The questions are :

  1. How do i do the sum of label12 and label10 so label3 will present a number int ?

  2. Where should i put this label3.Text line in the function ?

This is the code:

private List<string> test(string url, int levels,DoWorkEventArgs eve)
        {


            HtmlWeb hw = new HtmlWeb();
            List<string> webSites;
            List<string> csFiles = new List<string>();

            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 > 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 < webSites.Count(); i++)//&& i < 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;
            }

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:53:10+00:00Added an answer on June 12, 2026 at 2:53 pm

    To convert a string from a Label to a number, use the following:

    int number = Int32.Parse(someLabel);
    

    So your code should be:

    label3.Text = (Int32.Parse(label12.Text) + Int32.Parse(label10.Text)).ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that looks something like this: function pathfind (start,end,map) { this.Init =
i have this code and its working but i want it to return dailyTotals
I have this code for splitting input list into its halves. It seems to
I have this code: STRB R2, [R0,R1] and its opcode is 42 54 I'm
I have this code in my index.php. In Mozilla its ok. But in Ie
its a little bit hard to understand. in the header.php i have this code:
sorry about input mistakes, english its not my mother lang. I have this code
I have an implementation of lazyDataModel following this tutorial http://uaihebert.com/?p=1120 My code its a
//This is the function that will run every time a new item is added
I have this code in C (it's for study only): char x; uint64_t total

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.