Solved: how to MapPath to a parent directory through server.mappath in asp.net c#

try with this code
             Path.Combine(Directory.GetParent(Server.MapPath("")).FullName, "screenshots")
             With Server.MapPath you get your root folder, then with Directory.GetParent you get the root folder parent and finally you combine that with the "screenshot" folder using Path.Combine.
              I hope it helps.
Regards,

Post a Comment

0 Comments