I'm new in this domain and i really need some help plz !!! What i need is to take all the filenames of images, placed in a specific folder, and place them (filename) in a XML document. someone has an example ?? or a clue ??
thx a lot to everyone !!!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Subhendu DeRank #1,108 · 1.7K reputationPosted Dec 8, 2010, 8:20 AM EST
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;
namespace TestXML
{
class Program
{
static void Main(string[] args)
{
string _filepath = @"
DirectoryInfo _dirinfo = new DirectoryInfo(_filepath);
FileInfo[] _files = _dirinfo.GetFiles();
XElement _xml = new XElement("Images",
from _file in _files
select new XElement("Image", _file.Name));
Console.WriteLine(_xml);
}
}
}
Output is
======
Press any key to continue . . .
Thanks.....