| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 885 人关注过本帖
标题:dirInfo.GetDirectories().Length
只看楼主 加入收藏
xinanhai
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2010-6-8
结帖率:100%
收藏
 问题点数:0 回复次数:1 
dirInfo.GetDirectories().Length
DirectoryInfo dirInfo = new DirectoryInfo(path)
dirInfo.GetDirectories().Length
中dirInfo.GetDirectories().Length是啥子意思哦??
搜索更多相关主题的帖子: Length dirInfo 
2010-11-12 11:33
c1_wangyf
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:7
帖 子:665
专家分:2832
注 册:2010-5-24
收藏
得分:0 
是返回当前Path目录下面子目录的个数,当然你可以通过这个方法看看一共有多少个子目录:
            DirectoryInfo dirInfo = new DirectoryInfo(path);
            DirectoryInfo[] dir=dirInfo.GetDirectories();
            foreach (DirectoryInfo d in dir)
            {
                treeView1.Nodes.Add(d.ToString());
            }
            int i=dirInfo.GetDirectories().Length;//看看i是不是和treeview里面子节点的个数相等!!
2010-11-12 13:11
快速回复:dirInfo.GetDirectories().Length
数据加载中...
 
   



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

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