My problem is I need to display distinct records i.e.
files must contain only the records where names obtained from
filespath should not match with the
slist items.I have tried out the below code.but couldnt achieve it.can anyone suggest changes for this.thanks in advance..
public ActionResult Index()
{
string[] filesPath = Directory.GetFiles(Server.MapPath("~/abc"), "*.pdf");
List<FileInfo> files = new List<FileInfo>();
GetFilesList flist = new GetFilesList();
var list = flist.CategoryList();
string[] slist = list.ToArray();
foreach (string path in filesPath)
{
foreach (var s in slist)
{
string name = Path.GetFileName(path);
if(s != name)
{
files.Add(new FileInfo(Path.GetFileName(path)));
}
}
}
return View(files);
}