C
C#6mo ago
Turtles

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
Denis
Denis6mo ago
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.
Turtles
Turtles6mo ago
yeah thats what i though thought* ive heard of the possibility of allowing just dropping a file to select it? is that possible?
Mayor McCheese
Mayor McCheese6mo ago
why not just provide by command line args?
jcotton42
jcotton426mo ago
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()
Lex Li
Lex Li6mo ago
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.
Turtles
Turtles6mo ago
wow this looks really cool im definitely going to look into using this
Pobiega
Pobiega6mo ago
Its very good, but your code will end up being very similar to a full GUI app