I have little to no knowledge with C#. That being said, I have been tasked with a project of sorting a list based on the latest version of jQuery in a folder where a bunch of versions are held.
Currently, this is what I have:
public ActionResult Index()
{
//creating a DirectoryInfo object
DirectoryInfo mydir = new DirectoryInfo(@"\\edcapptest\E$\cdn\js\jquery");
// getting the files in the directory
FileInfo[] f = mydir.GetFiles();
List<string> myList = new List<string>();
foreach (FileInfo file in f)
{
myList.Add(file.Name);
}
myList.Sort();
return View(myList);
}
I have been thinking about ways I can go about doing this for a few days now, and have come up with little to no results(at least ones that work).
Any suggestions or help will be greatly appreciated.