| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 533 人关注过本帖
标题:[求助]目录与文件问题
只看楼主 加入收藏
weishj
Rank: 1
等 级:新手上路
威 望:2
帖 子:141
专家分:0
注 册:2007-4-22
收藏
 问题点数:0 回复次数:3 
[求助]目录与文件问题
大家好,我有好多文件,都需要在一些地方作一些类似的修改,所以想编个程序。
但有个问题,就是如何搜索一个目录下的所有文件,并得到每一个文件的文件名?
我知道用system("dir >>a.txt")可以把文件名放入a.txt中,然后可以从a.txt中读取文件名,但这样好象有些不伦不类了,恳请高手指点迷津。在此先向高手们致谢
搜索更多相关主题的帖子: 目录 文件 txt 搜索 
2007-07-14 16:06
HJin
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:401
专家分:0
注 册:2007-6-9
收藏
得分:0 

Standard C++ does not a file system library for you to use.

If you really want to do it, I recoommend using the popular boost fileystem library. I use that library for both windows and Linux systems. However, to install boost you need some efforts.

Another easy way to do it just on the windows system is "osdir.h". Try to google it.


I am working on a system which has no Chinese input. Please don\'t blame me for typing English.
2007-07-14 16:21
天空の城
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2007-7-1
收藏
得分:0 

_findfirst,_findnext;CFileFind也可以


2007-07-14 16:42
weishj
Rank: 1
等 级:新手上路
威 望:2
帖 子:141
专家分:0
注 册:2007-4-22
收藏
得分:0 
To HJin:
Thank you very much!
I've downloaded the header osdir.h and found it workes well.I'll study the header carefully when I finish my job.

weishj

[此贴子已经被作者于2007-7-14 16:52:09编辑过]


If you shed tears when you miss the sun, you also miss the stars.
2007-07-14 16:51
快速回复:[求助]目录与文件问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014225 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved