how about something like this:
static void Main(string[] args)
{
CreateFoldersFromPath(@"C:\manas\hello\abc");
}
private static void CreateFoldersFromPath(string PstrPath)
{
string LstrPath = PstrPath.Substring(0, 2);
string[] LlstFolders = PstrPath.Remove(0, 3).Split('\\');
for (int LiCount = 0; LiCount < LlstFolders.Length; LiCount++)
{
if (!Directory.Exists(LstrPath + LlstFolders[LiCount]))
{
LstrPath = string.Format(@"{0}\{1}", LstrPath, LlstFolders[LiCount]);
Directory.CreateDirectory(LstrPath);
}
}
}
Lets say you pass the C:\Drive\Home\Client\To\Folder\Folder1 to the function and it will create it for you.
You can take it as a start point and see if it helps.:rose: