public class PathType
{
public string Folder;
public string Extension;
public string FileName;
}
public static PathType CrackPath(string path)
{
PathType pathType = new PathType();
if (string.IsNullOrEmpty(path)) return pathType;
if (!File.Exists(path)) return pathType;
pathType.Extension = Path.GetExtension(path);
pathType.FileName = Path.GetFileNameWithoutExtension(path);
pathType.Folder = Path.GetDirectoryName(path);
return pathType;
}