Question How to get the directory (folder) on which user has done right click

.net framework , esd , ddd India
  • 10 years ago
    Hello, I have developed one application, and added it to right click pop-up menu of the folder. Whenever user right-clicks on folder and selects my application from pop-up menu, I want the path to that folder (on which user has done right click). I am using Directory.GetCurrentDirectory(), but it gives me path to the parent directory of the user right clicked directory. How can I get the path to the directory on which user has done right click? Regards Abhishek
  • 10 years ago
    Dim dDir As New System.IO.DirectoryInfo("Your Folder path") ' 'ToolStripMenuItem1 ' ToolStripMenuItem1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripMenuItem() {ContextSubMenu}) ' 'ContextSubMenu ' ContextSubMenu.Name = "ContextSubMenu" ContextSubMenu.Text = "Folder Name" ContextSubMenu.Tag = dDir

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth