Anthony Jones 27 November 2008 00:23:59 [ permanent link ]
"Chris Miller" <Chris(a)InfoGreat.com> wrote in message news:O4Gmr4$TJHA.584@TK2MSFTNGP06.phx.gbl...
Hi Folks,
The following snippet will let me enumerate files...
var fs = new ActiveXObject("Scripting.FileSystemObject");
var f = new Enumerator(fs.GetFolder(d).files);
for ( ; !f.atEnd(); f.moveNext())
{
:
}
How do I assert the order I want the files? Alphabetical by Name, Date of
Creation, Date of Last Access, you get the idea...
You can't control the order the files are retrieved from the Files collection (on an NTFS volume they will be in alphanumerical name order), you need first dump them into an array then sort the array.
var fs = new ActiveXObject("Scripting.FileSystemObject"); var f = new Enumerator(fs.GetFolder(d).files); var files = [];
for ( ; !f.atEnd(); f.moveNext()) files.push(f.item())
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .