SyntaxFix
Write A Post
Hire A Developer
Questions
Use below mentioned code to get the folder path
Path.GetDirectoryName(filename);
This will return "C:\MyDirectory" in your case