c# - Get list of temporary internet files -
var path = environment.getfolderpath(environment.specialfolder.internetcache); var dinfo = new directoryinfo(path); foreach (fileinfo f in dinfo.getfiles()) { console.writeline(f.tostring()); }
this prints out 1 file titled "desktop.ini". know temporary internet files virtual folder. how can iterate through files in virtual folder?
what accessing code top level folder. iterate through files need take account sub folders in temporary internet files.
static void main(string[] args) { var path = environment.getfolderpath(environment.specialfolder.internetcache); var dinfo = new directoryinfo(path); dostuff(dinfo); console.readline(); } static void dostuff(directoryinfo directory) { foreach (var file in directory.getfiles()) { console.writeline(file.fullname); } foreach (var subdirectory in directory.getdirectories()) { dostuff(subdirectory); } }
Comments
Post a Comment