Public list<model> GetFileName (string filePath)
{
var queryparam = Queryjson.tojobject ();
string[] filepaths = directory.getdirectories (FilePath);//Get all folder paths under directory
string[] fileNames = null; Declaring an empty array
ArrayList array = new ArrayList ();
list<fileword> lst = new list<fileword> ();
for (int i = 0; i < filepaths.length; i++)//Loop Get file name
{
FileNames = Directory.GetFiles (Filepaths[i]);//Put the file name in the array
foreach (var item in FileNames)//Add file name to ArrayList
{
Array. ADD (item);
}
}
for (int i = 0; i < array. Count; i++)
{
Model FW = new Model ();
File path
String FilePath = Array[i]. ToString (). Replace ("\ \", "/");//convert \ \ to/
Folder name
String templateclass = filepath.substring (0, Filepath.lastindexof ("/"));
String FName = Filepath.substring (Filepath.lastindexof ("/") + 1);
Fw. FName =fname.substring (0,fname.lastindexof ('. '));
Fw. Templateclass = templateclass.substring (Templateclass.lastindexof ("/") + 1);
Lst. Add (fw);//Adds a class to the LST collection
}
LST = lst. Skip (Number of pages * rows-number of lines). Take (number of rows). ToList ();//linq Group
return LST;
}
Use list to get the contents of the file uploaded to the directory for pagination display