<p>Any ideas on how to implement tab completion for a .NET (C#) Console Application?
And I mean within an application that is run and then loops for user input (like if you run ftp.exe without any arguments), like this: </p>

<pre><code>        string line = string.Empty;
        while (line != "exit")
        {
            //do something here
            Console.ReadLine();
        }
</code></pre>

<p>I know I probably couldn't actually use readline, but I would like to be able to do tab completion at that same point where you retrieve input from the user.</p>

[{'answer_id': 46352, 'author': 'Andrew Burns', 'author_id': 3683, 'author_profile': 'https://Stackoverflow.com/users/3683', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://msdn.microsoft.com/en-us/library/system.console.readkey.aspx" rel="nofollow noreferrer">Console.ReadKey</a></p>\n'}, {'answer_id': 46396, 'author': 'kenny', 'author_id': 3225, 'author_profile': 'https://Stackoverflow.com/users/3225', 'pm_score': 4, 'selected': True, 'text': '<p>Take a look at this code from the Mono project\n<a href="http://tirania.org/blog/archive/2008/Aug-26.html" rel="noreferrer">http://tirania.org/blog/archive/2008/Aug-26.html</a>\nI played with it some the other day.\nIt does a lot of command line editingy, but I don\'t think it does line completion.</p>\n'}, {'answer_id': 47594, 'author': 'Lars Mæhlum', 'author_id': 960, 'author_profile': 'https://Stackoverflow.com/users/960', 'pm_score': 3, 'selected': False, 'text': '<p>Do a Console.ReadKey().  </p>\n\n<p>If you get a Tab, look at what you have in the command buffer, and loop through your available commands. If <code>someCommand.Name.BeginsWith(currentinput)</code>, you have a winner, and you can write to screen a list of possible commands.  </p>\n\n<p>If <em>there is only one(TM)</em> you can substitute it with what the user had typed :)</p>\n'}, {'answer_id': 38383928, 'author': 'Fábio Junqueira', 'author_id': 2716578, 'author_profile': 'https://Stackoverflow.com/users/2716578', 'pm_score': 3, 'selected': False, 'text': '<p>I created a small lib to add this functionality to an app i made:</p>\n\n<p><a href="https://github.com/fjunqueira/hinter" rel="noreferrer">https://github.com/fjunqueira/hinter</a></p>\n\n<p>It might not suit your needs, but you can feel free to edit it.</p>\n'}, {'answer_id': 57116500, 'author': 'Olivier Duhart', 'author_id': 5006676, 'author_profile': 'https://Stackoverflow.com/users/5006676', 'pm_score': 1, 'selected': False, 'text': '<p><a href="https://github.com/tonerdo/readline" rel="nofollow noreferrer">https://github.com/tonerdo/readline</a> is what you need.\ngreat lib available as a nuget from the talented dev tonerdo.</p>\n<p><em>pasted from the site:</em></p>\n<blockquote>\n<p>...<br/>\n<strong>ReadLine</strong> is a GNU Readline like library built in pure C#\nIt can serve as a drop in replacement for the inbuilt <code>Console.ReadLine()</code> and brings along with it some of the terminal goodness you get from unix shells, like command history navigation and tab auto completion.<br/>\n...</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/46346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/194/']