I have a few folders and every folder contains a few .DLL files. The DLL can be executed, and I have to ban CRUD operations by this DLL outside of its own folder.
But the DLL can perform any save operation it needs, as long as its in the same folder where the DLL is situated.
For example:
//this code can be executed succesfully
public static void Create()
{
string path = Directory.GetCurrentDirectory() + "\\file.txt";
File.Create(path);
}
//but execution of this code I have to ban
public static void Create()
{
File.Create("../file.txt");
}