Get File SystemInfo

image_pdfimage_print
   
 

#region License
// (c) Intergen.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
#endregion

using System;
using System.Text;
using System.IO;
using System.Web;
using System.Web.Hosting;

namespace Utilities.IO
{
  public class FileUtils
  {
    public static FileSystemInfo GetFileSystemInfo(string path)
    {
      if (File.Exists(path))
      {
        return new FileInfo(path);
      }
      else if (Directory.Exists(path))
      {
        return new DirectoryInfo(path);
      }

      return null;
    }

  }
}

   
     


This entry was posted in File Stream. Bookmark the permalink.