hi
You can also try System.IO.FileSystemInfo and System.IO.DirectoryInfo Class to retrieve the path
System.IO.FileInfo mobjFileInfo;
mobjFileInfo = new FileInfo("filepath");
mobjFileInfo.DirectoryName - Gets a string representing the directory's full path.