Need to know how i can give a check for parent directory access.
case 1: Path = https://18.56.199.56/Project/Docs/../Hello.File.txt
case 2: Path = https://18.56.199.56/Project/Docs/Hello..File.txt
Using some check i need to find the parent directory access(like case 1) and not ".." in the file name(like case 2)
With the below code i am getting the expected output but i need some predefined methods like Uri.AbsoluteUri Properties to do the same job.
class Program
{
static void Main(string[] args)
{
if (Path.Contains("../")) {
// do something
}
}
}
Requirement: Need some predefined methods like below to do this job. Using below code i am getting isFile as false.
var isFile = new Uri(Path).AbsoluteUri.Split('/').Contains("..");