File listing – List all file in a folder

There is code for make a listing of all file in a folder :

static void myFileList(Args _args)
{
    FilePath                sFilePath;

    System.IO.DirectoryInfo di;
    System.IO.FileInfo[]    fis;
    System.IO.FileInfo      fi;
    int                     i;
    int                     l;
    ;

    sFilePath   = WinAPI::getTempPath();
    di          = new System.IO.DirectoryInfo(sFilePath);
    fis         = di.GetFiles();
    l           = fis.get_Length();
    
    for (i = 0; i < l; i++)
    {
        fi = fis.GetValue(i);
        info(fi.get_FullName());
    }
}
Advertisements