读取文件夹中所有文件和文件夹的代码 [英] Code to read the all the files and folder inside the folder

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

问题描述

我想读取文件夹内的所有数据


ankita mali

I want to read all the data inside the folder


ankita mali

推荐答案

尝试:
string[] files = Directory.GetFiles(path);
foreach (string file in files)
    {
    string s = File.ReadAllText(file);
    ...
    }


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

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