string basepath = @"C:\somefolder\subfolder\bin"; // is defined in runtime
string relative = @"..\..\templates";
string absolute = Magic(basepath, relative); // should be "C:\somefolder\templates"
Can you help me with Magic method? Hopefully not too complicated code.
Is there the “Magic” method in .NET Framework?
If you look at the
Pathclass there are a couple of methods which should help:and
So:
Although the second step isn’t strictly needed – it would give you a “cleaner” path if you were printing out say.