CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["storageConnectionString"]);
CloudFileClient fileClient = cloudStorageAccount.CreateCloudFileClient();
CloudFileShare fileShare = fileClient.GetShareReference(ConfigurationManager.AppSettings["shareName"]);
var sourceName = fileShare.GetRootDirectoryReference().GetDirectoryReference((ConfigurationManager.AppSettings["sourceName"]));
I want to check which is latest file uploaded into sourcename
I tried using below code -
sourceName.Uri = {https://test.file.core.windows.net/XC/MainFolder/}
sourceName.Uri.AbsolutePath = {/XC/MainFolder/}
var directory = new DirectoryInfo(sourceName.Uri.AbsolutePath);
var myFile = (from f in directory.GetFiles()
orderby f.LastWriteTime descending
select f).First();
error as - System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\XC\MainFolder'.'
which is obvious as it is not a local folder.
how can i use https://test.file.core.windows.net/XC/MainFolder/ to loop and check the latest file ? instead go into each and every file and sub-folder and check its lastModified property , is there any wasy way to do?