将整个文件夹结构显示为字符串 [英] display entire folder structure as a string

查看:71
本文介绍了将整个文件夹结构显示为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

实际上,我在"D"中有一些文件夹结构,例如此示例文件夹
| _hello文件夹---- | __hi.txt
| _file.txt | _bye.txt
但是现在我们将整个文件夹结构显示为字符串,然后可以对其进行反序列化..
如果有人知道,请让我知道....

hi to all..

actually i have some folder structure in ''D'' like this sample folder
|_hello folder----|_hi.txt
|_file.txt |_bye.txt
but now we have display as entire folder structure as string and then we can deseralize it..
if any body knows pls let me know....

推荐答案

这可能会有所帮助,

It might be helpful,

public string GetDirectories()
{
    string result = string.Empty;
    string seperator = ";";
    Array.ForEach(Directory.GetDirectories("D:\\").ToArray(), item => { result = string.Concat(result, item, seperator); });
    return result;
}



:)



:)


这篇关于将整个文件夹结构显示为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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