Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding data to an ArrayList
    text
    copied!<p>I've got the following:</p> <pre><code>// Begin the WebRequest to the desired RSS Feed WebRequest myRequest = WebRequest.Create(url); WebResponse myResponse = myRequest.GetResponse(); // Convert the RSS Feed into an XML document Stream rssStream = myResponse.GetResponseStream(); XmlDocument rssDoc = new XmlDocument(); rssDoc.Load(rssStream); // This uses an XPath expression to get all nodes that fall // under this path. XmlNodeList rssItems = rssDoc.GetElementsByTagName("row"); ArrayList returnArrayList = new ArrayList(); CharData cd = new CharData(); for (int i = 0; i &lt; rssItems.Count; i++) { cd.CharacterName = rssItems[i].Attributes["name"].Value; cd.CharacterID = rssItems[i].Attributes["characterID"].Value; cd.CorporationID = rssItems[i].Attributes["corporationID"].Value; cd.CorporationName = rssItems[i].Attributes["corporationName"].Value; } this.richTextBox1.Text = cd.CharacterName+"\r\n"+cd.CharacterID+"\r\n"+cd.CorporationID+"\r\n"+cd.CorporationName+"\r\n"; </code></pre> <p>CharData Class:</p> <pre><code>class CharData { private string _charName; private string _charID; private string _corporationID; private string _corpName; public string CharacterName { get { return _charName; } set { _charName = value; } } public string CharacterID { get { return _charID; } set { _charID = value; } } public string CorporationID { get { return _corporationID; } set { _corporationID = value; } } public string CorporationName { get { return _corpName; } set { _corpName = value; } } } </code></pre> <p>Now, how do I add multiple chars data the system and retrieve them later?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload