HI
In C# is there any option to check whether a file or image exists inside a folder? if anybody knows please help me
thanks
FareedaHussain
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
Alok UniyalRank #8,369 · 223 reputationPosted Jun 12, 2015, 11:46 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 13, 2015, 12:16 AM EDT
FileInfo.ExistsProperty:DirectoryInfo di = new DirectoryInfo(ProcessingDirectory); FileInfo[] TXTFiles = di.GetFiles("*.xml"); if (TXTFiles.Length == 0) { log.Info("no files present") } foreach (var fi in TXTFiles) log.Info(fi.Exists);File.ExistsMethod: