Android Question Getting number of files of manually created folders


Active Member
Licensed User
Longtime User
Hello, i need to get the number of file in some folders manually moved to file.dirassets
in future releases is i may need to add some more files, i'd like to avoid to correct all the code by updating the default values.

Dim fileCount As List
fileCount = File.ListFiles(File.DirAssets) 'OK

fileCount = File.ListFiles(File.DirAssets&"/foldername") 'NOT OK
'error AssetsDir/foldername is not a folder.


'Bad code
Dim numfiles as int = 50 'I know the total number of files in file.dirassets/foldername
if counter <= 50 Then....

'I prefer
if counter <= filecount.size Then....

any walktrought?