SyntaxFix
Write A Post
Hire A Developer
Questions
To avoid issues with trailing \, call it this way:
string ParentFolder = Directory.GetParent( folder.Trim('\\')).FullName;