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

  • SEARCH
  • Home
  • 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 8558431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:48:37+00:00 2026-06-11T15:48:37+00:00

I am new to Windows phone. I’m storing four values in Dictionary<string, object> .

  • 0

I am new to Windows phone.

I’m storing four values in Dictionary<string, object>. Once I completed when I check the entries it is showing 7 entries where three are null Keys and values.

code:

   Dictionary<string, string> obj = new Dictionary<string, string>();
    private void button1_Click(object sender, RoutedEventArgs e)
    {
        obj.Add("K2", "V2");
        obj.Add("K3", "V3");
        obj.Add("K4", "V4");
        obj.Add("K5", "V5");
    }

Any help?

code where i used up dictionary:

  private void GetLoginCallback(IAsyncResult asynchronousResult)
        {
            try
            {
                Dictionary<string,object> Parameters = new Dictionary<string,object>();

                /**httprequest for making asynchronous call**/
                HttpWebRequest httpRequest = (HttpWebRequest)asynchronousResult.AsyncState;
                /**response from the httprequest**/
                HttpWebResponse httpresponse = (HttpWebResponse)httpRequest.EndGetResponse(asynchronousResult);
                /**Reading the response as stream**/
                Stream streamResponse = httpresponse.GetResponseStream();
                using(StreamReader streamRead = new StreamReader(streamResponse))
                {
                    var response = streamRead.ReadToEnd();
                    //Deployment.Current.Dispatcher.BeginInvoke(new Action(() =>
                    //{
                    if (response != null && httpresponse.StatusCode == HttpStatusCode.OK)
                    {
                        WebHeaderCollection headers = httpresponse.Headers;
                        /**getting Session_ID **/
                        string session_cookie = headers[DisplayMessage.Set_Cookie];
                        string sessionCookie = headers[DisplayMessage.Set_Cookie];
                        string[] values = sessionCookie.Split(DisplayMessage.Split_SemiCollen);
                        string[] jID = values[0].Split(DisplayMessage.Split_EqualTo);
                        jsessionId = jID[1];

                        /**storing Authentication parameters in dictionary**/
                            Parameters.Add("Username", "test4");
                            Parameters.Add("Password", "*****");
                            Parameters.Add("JSessionID", "FGBfdhhfuhuhhbh_Path");
                            Parameters.Add("SessionCookie","FGBfdhhfuhuhhbh_Path;dpk");


                        //}));
                    };
                }
            }
            catch(Exception ex)
            {

            }
        }
  • 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-11T15:48:39+00:00Added an answer on June 11, 2026 at 3:48 pm

    If you mean that in the debugger, the dictionary is showing with 4 items that are what you are expecting and 3 items that are empty, that’s because that’s how the data is stored internally. Dictionary is implemented as a hash table. And there are two reasons why it’s a good idea to have empty items in a hash table:

    1. With hash tables, there is always the possibility of a collision (two keys that map to the same “bucket”). If you keep a fraction of the hash table empty, there will be only a small amount of collisions, on average (assuming a good hash function for the given items).

    2. With collections that grow one item at a time, it’s better to allocate more memory than you need right now, so you don’t have to copy the whole collection every time you add a new item. Other collections behave this way too, for example List<T>.

    But you don’t have to actually worry about this, because when you access the dictionary from your code, you won’t see those empty items.

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

Sidebar

Related Questions

Where can I find the SDK for new Windows Phone 7?
All, I am very new to Windows Phone and really don't know where to
I am new to the windows phone development, and I am struggling to get
I'm new in programming windows phone 7 but get really tired cuz i spend
All, I am new to Windows 7 Phone. My situation is that I have
I am very new at all this c# Windows Phone programming, so this is
I'm pretty new to programming C# and windows phone... In my Windows Phone App
I created a new project, Windows Phone 7.0 Since i wanted the DockPanel, i
I've downloaded the most recent Windows.Phone.Controls.Toolkit and in the app.xaml.cs changed RootFrame = new
I'm new to RestSharp. And I use it in my Windows Phone 7.1 project.

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.