How to extract the information between the ImageUrl of an Advertisement file

Platform: ASP.NET| Category: AdRotator

Use namespace System.Xml

VB.NET


Dim xmlDoc As New XmlDocument
xmlDoc.Load(Server.MapPath(AdRotator1.AdvertisementFile))
Dim imgArrList As New ArrayList
Dim xmlNode As XmlNode
For Each xmlNode In xmlDoc.SelectNodes('/Advertisements/Ad/ImageUrl')
	imgArrList.Add(xmlNode.InnerText)
Next 

C#


XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath(AdRotator1.AdvertisementFile));
ArrayList imgArrList = new ArrayList();
foreach (XmlNode xmlNode  in xmlDoc.SelectNodes('/Advertisements/Ad/ImageUrl'))
{
	imgArrList.Add(xmlNode.InnerText);
}

Share with