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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:52:51+00:00 2026-05-12T18:52:51+00:00

I need to keep track of how many items are in a node of

  • 0

I need to keep track of how many items are in a node of this one attribute in C# and I have no idea on how to load an array, starting with 1 and ending with a variable

The code for this portion is this

//Loads file containing OSXInstaller File List
doc.Load("Distribution.xml");
XmlNodeList ChoiceNode = doc.GetElementsByTagName("choice");
foreach (XmlNode choices in ChoiceNode)
{
    //Code Executed only  for packages, not categories
    if (choices.HasChildNodes == true)
    {
        choicetitle.Add(choices.Attributes["title"].InnerText);
        //Counts the number of items with an attribute of "title" in the 
        //distributions file, so if the user selects #1 in the list box it will 
        //know what number one is
        choicelistcount++;
    }
    if (choices.HasChildNodes == false)
    {
    }
    else
    {
        MessageBox.Show("Your Mac OS X Installation disk is damaged or was mounted improperly, please try again and doube-check your information!");
    }
}

I’m trying to get it to count the number of items with the attribute of title, then being able to print out all of the items in the list

choicetitle is the string list

I want it to look something like:

listBox1.Items.Add(choicetitle[1-choicetitlecount]);

edit: To answer some of the comments below;

I put this together in a very short time and things like spell-checking don’t really matter to me

The reason why I also include an else statement is because it adds an additional check whether the OSX Install Disk was mounted

The Program is a tool to Add & Remove packages to the OSX Installer, not as in a live-cd type thing but to add packages that you can install onto your new OS X installation
website is at http://osxreformer.org

  • 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-05-12T18:52:51+00:00Added an answer on May 12, 2026 at 6:52 pm

    Your question is unclear, but you probably want to use the List<T> class, which can hold any number of elements.

    You can create a List<SomeType>, and then add as many SomeType objects to it as you want, without worrying about size or capacity. (unless you run out of memory)

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

Sidebar

Related Questions

No related questions found

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.