Method to calculate the amount of files¶
The following example shows the implementation of a method that calculates the number of files in the project folder and returns the result in the output parameter.
public class RuntimeScript1 : NetLogic.BaseNetLogic
{
[ExportMethod]
public void RuntimeScript1Method(out int filesCount)
{
var projecfilestpath = Project.Current.ProjectDirectory;
filesCount = 0;
DirectoryInfo d = new DirectoryInfo(projecfilestpath);
FileInfo[] Files = d.GetFiles("*.*");
foreach (FileInfo file in Files)
{
++filesCount;
}
}
}