title: PathTooLongException in C# code
body: <p>i have the following code:</p>
  
  <pre><code> public static void Serialize()
      {
  
          List&lt;string&gt; dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
          List&lt;string&gt; dirFiles = new List&lt;string&gt;();
          foreach (string p in dirs)
          {
              string path = p;
  
              string lastAccessTime = File.GetLastAccessTime(path).ToString();
  
  
              bool DirFile = File.Exists(path);
              FileInfo fInf = new FileInfo(path);
              long lengthInk = fInf.Length / 1024;
  
              DateTime lastWriteTime = File.GetLastWriteTime(p);
              dirFiles.Add(p + "|" + lastAccessTime.ToString() + "|" + DirFile.ToString() + "|" + lastWriteTime.ToString() + "|" + lengthInk.ToString() + " kb");
  
  
          }
  </code></pre>
  
  <p>I keep hitting a PathTooLongException error with the following line:</p>
  
  <pre><code>string lastAccessTime = File.GetLastAccessTime(path).ToString();
  </code></pre>
  
  <p>The application drills into a drive and finds all files/folders w/in the drive.  I cannot change this path but since it is above 260 characters...how to work around this?  </p>