title: iterate through azure storage absolute path c#
body: <pre><code> 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"]));
  </code></pre>
  
  <p>I want to check which is latest file uploaded into <code>sourcename</code>
  I tried using below code - </p>
  
  <pre><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();
  </code></pre>
  
  <p>error as - 
  System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\XC\MainFolder'.'</p>
  
  <p>which is obvious as it is not a local folder.</p>
  
  <p>how can i use <a href="https://test.file.core.windows.net/XC/MainFolder/" rel="nofollow noreferrer">https://test.file.core.windows.net/XC/MainFolder/</a> 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?</p>