irectory.GetLogicalDrives() 、Directory.GetDirectories方法()

1. Directory.GetLogicalDrives 方法 ()

检索此计算机上格式为 "<drive letter>:\" 的逻辑驱动器的名称。例如C盘 D盘等

命名空间:   System.IO

语法:public static string[] GetLogicalDrives()

返回值Type: System.String[]   字符串

2.Directory.GetDirectories方法()

返回指定目录中的子目录的名称(包括其路径)。

命名空间:   System.IO

语法:public static string[] GetDirectories(string path)

path Type: System.Strin  

要搜索的目录的相对或绝对路径。 此字符串不区分大小写。

 

 

返回值 Type: System.String[]  

指定路径中子目录的完整名称(包含路径)的数组;如果未找到任何目录,则为空数组

 

 

3.Directory.GetFiles()

 

GetFile(String) 返回指定目录中文件的名称(包括其路径) 

posted @ 2017-02-27 03:28  hannah520  阅读(3441)  评论(0)    收藏  举报