Click here to Skip to main content
15,923,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to implement one concept in my application like command prompt command history.
(in command prompt if we press up or down arrow previously typed commands will display is it possible to implement this concept in c# application )
Posted

Yes.

Exactly how is up to your application, but it's easiest for a console app...

Try creating a List of strings t class level, and each time your user enters a command, add it on teh bottom.
Then, when they press the up arrow key, you can move back through the list, showing them one by one on your command line.
 
Share this answer
 
As already suggested by our Original, a simple list could be enough. For a more advanced approach (only if you need it) have a look at Command Design Pattern[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900