Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15685

.NET Find Most Recently Modified File incl. Recursively/Subfolder Support

$
0
0
Hi everyone,

I am a rusty VB6 programmer trying to finally take a serious plunge into .NET. I apologize for this basic request in advance. Here’s what I’m trying to accomplish under VB.NET:

* Assume “MyFileTest.ini” can occur in multiple subfolders

Loop through a series of folders/subfolders looking for a specific file name: “MyFileTest.txt” for example.

Found file results might look like this:
C:\MyFileTest.txt
C:\A_Directory\MyFileTest.txt
C:\A_Directory\ABDirectory\MyFileTest.txt
C:\F_Directory\MyFileTest.txt

And have a variable (function?) return only the most recently modified file found (e.g., “newest” version of MyFileTest.txt from any location)

Bonus Request: Dump each file found result (“MyFileTest.ini”) into a List Box with column headings – File Name, File Extension, File Path, Last Date Modified (historically I use 10Tec.com iGrid ActiveX grid control which is just awesome but want to start off more simply here).

Thank you for any general guidance or sample code sets - kind of getting excited about delving into .NET but have a lot to learn.
As an aside - any maybe should be for a different post... But if anyone has come across a particularly good help/support resource that kind of structures things like "In VB6 you used to do this, in VB.NET it's now done like this) please let me know.

Thank you!

Viewing all articles
Browse latest Browse all 15685

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>