how to add a file select dialogue box to a console based app
hello! i know that you cant actually do what i said i wanted to do in the title of this post, but, i was wondering if there was some way to easily get from my console based code to something that would allow me to include a file select dialogue box
7 Replies
The best and most native console way of doing this would be to display the file selection using text in the console
Otherwise... I believe you'd have to reference one of the available UI framework's libraries to access a file selection dialog
But even so, that would be like creating a Frankenstein's monster.
yeah thats what i though
thought*
ive heard of the possibility of allowing just dropping a file to select it? is that possible?
why not just provide by command line args?
at least on Windows, the path to a dragged in file will be pasted in when you drop it on the console
so just do a
Console.ReadLine()
If you want to write such an app, you should evaluate if Terminal.Gui is the option, https://github.com/gui-cs/Terminal.Gui
GitHub
GitHub - gui-cs/Terminal.Gui: Cross Platform Terminal UI toolkit fo...
Cross Platform Terminal UI toolkit for .NET. Contribute to gui-cs/Terminal.Gui development by creating an account on GitHub.
wow this looks really cool
im definitely going to look into using this
Its very good, but your code will end up being very similar to a full GUI app