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 8699409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:56:18+00:00 2026-06-13T01:56:18+00:00

The code im trying wich is not working: private void clearRichtextBox() { richTextBox2.Clear(); foreach

  • 0

The code im trying wich is not working:

private void clearRichtextBox()
        {
            richTextBox2.Clear();
            foreach (KeyValuePair<string, List<string>> kvp in LocalyKeyWords)
            {
                richTextBox2.AppendText("Url: " + kvp.Key + " --- " + "Localy KeyWord: " + kvp.Value);
            }

        }

LocalyKeyWords is a List > type of Dictionary.
Where string is the Key and List is the Value.

http://www.google.com is the Key for example and google is the value.

Now in this case LocalyKeywords contain 3 indexs each one have a Key and a Value.
I want after i cleared the richTextBox2 to add from the List all the Keys and Values to the richTextBox in a Format like this:

Url: http://www.google.com --- Localy Keyword: google
Url: http://www.cnet.com --- Localy Keyword: cnet
Url: http://www.microsoft.com --- Localy Keyword: microsoft

But im not getting it the way i did it.

How can i do it ? Something wrong with the foreach i prefer to make it with FOR and not foreach.

The List is built as Key,Value in the text file on my hard disk fhr format is like this:

http://www.cnet.com,cnet

Then in the constructor im reading it from the text file and put back the key and value into the List like this:

private void richTextBoxLoadKeys(Dictionary<string, List<string>> dictionary, string FileName)
        {
            string line = System.String.Empty;
            using (StreamReader sr = new StreamReader(keywords))
            {
                while ((line = sr.ReadLine()) != null)
                {
                    string[] tokens = line.Split(',');
                    dictionary.Add(tokens[0], tokens.Skip(1).ToList());
                    richTextBox2.AppendText("Url: " + tokens[0] + " --- " + "Localy KeyWord: " + tokens[1]);
                }
                sr.Close();
            }
        }

After loading the key and values in the constructor and using a breakpoint on the List i see:

enter image description here

  • 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-13T01:56:20+00:00Added an answer on June 13, 2026 at 1:56 am

    You should iterate through the kvp.Value,it is also a list so you have to add each item from the list in the richtextbox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code is trying to remove any duplicate characters in a string. I'm
I'm using the javascript code below trying to extract the number after gallery-entry_ in
I'm getting an error in my python code when trying to import one of
I am having an issue converting type. I was trying code like this (minimal,
I´m trying to code a tooltip (Yes I know, I have my reasons to
I'm trying to code a Linq MinBy extension method public static class Extensions {
I am trying to code AES using Cipher Block Chaining(CBC) mode. I am pretty
I am trying to code the following query using Zend_Db api's: select * from
I'm trying to code a basic 'display a map from KML' website, and am
I'm trying to code this site (keyword trying) and I'm trying to figure out

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.