In .NET is there any API that allows me to restrict some IO operations to the specified path?
For example:
Root Path: C:\Test\
Now I want to call a function like this:
IO.Directory.CreateDirectory("../testing/",Root)
And now I want the API to handle this situation for me and do not create a folder other than the specified directory.
So this should be created as c:\Test\testing\
instead of c:\testing\
.
I know I can manually do this but I thought maybe there is an API that I don't know which supports such a thing.
The thing is I've got bunch of random strings and I'll crate folders and files based on them, I don't want to write anything to another folder because one of these strings include a string like "../"