This question is not for how to open a console app by dragging and dropping a file onto the exe and then accessing the file path as an argument.
Instead, this is for handling the drag/drop of a file onto an already-open console window. If you've ever done this while waiting for input on a Console.ReadLine()
, you will know that it will input the dragged/dropped file path into the console window so that you can access it. The problem is that it wants to wrap the path in double quotes which causes problems with a lot of the methods in the IO namespace.
If I could create a single handler to intercept the path before it writes it, I could sanitize away the quotes in a single place before returning the string. Any way to do this?