简体   繁体   English

建立控制台应用程式档案总管C ++

[英]build a console application file explorer c++

I need to make a windows console application file explorer using c++ , but I couldn't figure out how to use functions to display files nor how am I going to make it look like knowing that console application doesn't support buttons or displaying lists , specially that the project must be based on windows.h library. 我需要使用c ++制作Windows控制台应用程序文件资源管理器,但是我无法弄清楚如何使用函数来显示文件,也无法弄清楚如何知道控制台应用程序不支持按钮或显示列表,特别是该项目必须基于Windows.h库。 any tip, advice or suggestion may be helpful , thank you ! 任何提示,建议或建议都可能有所帮助,谢谢!

Have a look at http://www.martinbroadhurst.com/list-the-files-in-a-directory-in-c.html and scroll down to method 4. There you can see a possible implementation of a read-directory function. 看看http://www.martinbroadhurst.com/list-the-files-in-a-directory-in-c.html并向下滚动到方法4。在那里,您可以看到read-directory的可能实现。功能。 You should store a default start path, implement some console arguments as commands, then, whenever the user writes a command (for example goUp) ,change the path accordingly (in this case, remove the last foldername), call the function, which reads the directory, again and output all files in that folder. 您应该存储一个默认的开始路径,将一些控制台参数作为命令实现,然后,每当用户编写命令(例如goUp)时,相应地更改路径(在这种情况下,删除最后一个文件夹名),则调用该函数,该命令将读取目录,然后输出该文件夹中的所有文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM