查找文件和文件夹 [英] Find Files and folders

查看:115
本文介绍了查找文件和文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的是类似于windows

查找文件和文件夹的搜索。我正在放一个开始目录和

想要查找所有文件(包括子文件夹中的文件)所以我


可以写每行到一个主文件。我有它工作,但它使用

循环,它非常慢。是否有一个函数可以从文件夹和子目录中获取所有

文件?

what i am trying to do is something similar to the search that windows
does to find files and folders. I am putting a start directory and
want to find all the file (including the files in the sub folders) so i

can write each line to a master file. i have it working but it uses
loops and it extremely slow. Is there a function that grabs all the
files from a folder and subdirectories?

推荐答案

" frogman7" < fr ****** @ googlemail.comwrote in news:1160774077.181291.188630

@ m7g2000cwm.googlegroups.com:
"frogman7" <fr******@googlemail.comwrote in news:1160774077.181291.188630
@m7g2000cwm.googlegroups.com:

可以将每一行写入主文件。我有它工作,但它使用

循环,它非常慢。是否有一个函数可以从文件夹和子目录中获取所有

文件?
can write each line to a master file. i have it working but it uses
loops and it extremely slow. Is there a function that grabs all the
files from a folder and subdirectories?



你是如何写出文件的?


你在输出之前连接数据吗?

How are you writing out to the file?

Are you concatenating the data before outputting?


我目前正在使用streamwriter。当我循环并找到

文件时,我将一个字符串写入文件,并在其末尾返回。但

也许这就是为什么它如此缓慢

I am using streamwriter at present. as i loop through and find the
file i write a string to the file with a return at the end of it. but
maybe that is why it is so slow


frogman7写道:
frogman7 wrote:

我目前正在使用streamwriter。当我循环并找到

文件时,我将一个字符串写入文件,并在其末尾返回。但是

也许这就是为什么它如此缓慢
I am using streamwriter at present. as i loop through and find the
file i write a string to the file with a return at the end of it. but
maybe that is why it is so slow



你如何获得目录信息?当我最近尝试过类似的东西时,那是源头减速的原因。

How are you obtaining the directory information? That was the source
of slowdown when I tried something similar recently.


这篇关于查找文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆