public static string GetProperty(string filePath, PropertiesEnum property) { var folder = new Shell32.Shell().NameSpace(Path.GetDirectoryName(filePath)); var item = folder.ParseName(Path.GetFileName(filePath)); var fixed_Data = RemoveMiscChar(folder.GetDetailsOf(item, (int)property)); return(fixed_Data); }
public static TimeSpan GetTimeSpanProperty(string filePath, PropertiesEnum property) { var folder = new Shell32.Shell().NameSpace(Path.GetDirectoryName(filePath)); var item = folder.ParseName(Path.GetFileName(filePath)); var fixed_Data = RemoveMiscChar(folder.GetDetailsOf(item, (int)property)); if (!string.IsNullOrWhiteSpace(fixed_Data)) { return(TimeSpan.Parse(fixed_Data)); } else { return(new TimeSpan()); } }