Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

How to find all files in a directory - code must run both as RTC-Client and NAS

$
0
0

Hi

I want to find all files in a directory given a specific prefix and extension. I cannot find how to do this in Codeunit 419 "File mangement" Version NAV2013.

There is some code-example at Mibuso using DotNet (se below) - but this code works well running at Client but does not work running at a NAS.

Do you have another example ?

Thank you in advance.

Best regards

odri

 

 

Example

Obj := Folder.GetFiles('C:\Temp','*.txt');
Lst := Lst.List;
Lst.AddRange(Obj);
MESSAGE('%1',Lst.Count);
FOR i := 0 TO Lst.Count - 1 DO BEGIN   MESSAGE(FORMAT(Lst.Item(i))); END;

Folder   DotNet   System.IO.Directory.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'    Lst   DotNet   System.Collections.Generic.List`1.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'    Obj   DotNet   System.Object.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'   

 

 

 

 

 


Viewing all articles
Browse latest Browse all 29197

Trending Articles



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