am trying to find the right code to retrieve a filename that has a known component and an unknown component using dotnet in NAV2009R2 RTC.
The filename has the format 1234567_????.xml. (The directory name is always know as well.)
I have been trying a couple of dotnet types that seem to work, but I have not figured out how to return the actual file name.
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.System.IO.Directory
and
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.System.IO.DirectoryInfo
The second one has a property for FullName, but I get an error: System.IO.FileInfo[].FullName not found when I execute it.
Some of the examples talk about arrays, but I get a compile error if I add an array number.
(I am using dotnet, so it will still work when we upgrade.)
0
Answers
It returns a file list (FileInfo-Array) from the current directory (represented by DirectoryInfo) matching the given search pattern. For an inspiration how to use it, please have a look into the code at this (translated) blog post: Replace table "File" with DotNet. Even if GetFiles() is used without pattern, I think you should get the point.
Carsten
==> How To Ask Questions The Smart Way
This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
The German blog was most helpful.
For those of us whose German is as good as my dotnet, there is a good English translation.
http://mibuso.com/blogs/davidmachanick/