0

I want to be able to have the current open filepath name read and then display the options of filtered extentions. So for example if the currently open folder is say c:\Thisfolder and it has .jpgs and .txt files in it I want to be able to list a single .txt file in a selection area to choose from as the default file. I have tried to use DirectoryInfo and Folder Browser Dialog but no joy at the moment.

Many thanks

I will be sending my clients a folder with jpgs and a single file with an .syvw extention. What I want is for the program to read the .syvw file and show it as an option to open it. In the same way a folder will open showing the contents of a USB or disc once it is inserted into the computer.

1 Answers1

0

Tried:

Using System.IO; ..

String currentPath = Directory.GetCurrentDirectory();

?

hardyVeles
  • 1,112
  • 11
  • 13
  • that gives me the current directory of the .exe file of the program. What I need is the filepath of the directory or folder when say a USB is inserted into the computer. The computer shows the USB as an open folder, it is that filepath I need to be be able to access. – Steve Galvin May 13 '17 at 11:47
  • Well, probably a way would be possible if you monitor active processes using `System.Diagnostics.Process` namespace and do something once you detect new instance of "Explorer.exe". Check out [GetProcessesByName](https://msdn.microsoft.com/en-us/library/system.diagnostics.process.getprocessesbyname(v=vs.100).aspx). – hardyVeles May 13 '17 at 21:40