To fix your original problem :
You're creating a new instance of the array list for each iteration through the loop.Code:foreach (HtmlAgilityPack.HtmlNode node in rowNodes) { string url_1 = node.InnerText; urlpool0 = new ArrayList(); // problem is here ! creating a new list every time around the loop urlpool0.Add(url_1); }
Do this instead :
As a note you should be using List<string> instead of ArrayList. This is the recommended dynamically sizing list class as of .NET 2.0. ArrayList is a 1.1 collections object.Code:urlpool0 = new ArrayList(); foreach (HtmlAgilityPack.HtmlNode node in rowNodes) { string url_1 = node.InnerText; urlpool0.Add(url_1); }
Darwen.




Reply With Quote