What does @ "../ .." mean on the way?

I am following this tutorial from MSDN.

There is something I saw in the code that I cannot understand

    private void PopulateTreeView()
    {
        TreeNode rootNode;

        DirectoryInfo info = new DirectoryInfo(@"../.."); // <- What does @"../.." mean?
        if (info.Exists)
        {
            rootNode = new TreeNode(info.Name);
            rootNode.Tag = info;
            GetDirectories(info.GetDirectories(), rootNode);
            treeView1.Nodes.Add(rootNode);
        }
    }
+5
source share
3 answers

@intended for the line in the transcript, so the line is processed as is. Especially useful for c paths \that can be considered escape characters (e.g. \n)

../..- the relative path, in this case two levels up. ..represents the parent of the current directory, etc.

+7
source

..is the container directory. Thus, it ../..means "up" twice.
For example, if your current directory C:/projects/a/b/c, it ../..will beC:/projects/a

+4
source

new DirectoryInfo(@"../..") " ".

@ .

+3

All Articles