文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C# Get a folder or file list which finished sequence line. 直接得到 排序后 的 文件列表

C# Get a folder or file list which finished sequence line. 直接得到 排序后 的 文件列表

时间:2011-01-12  来源:zencorn

{

public int Compare(object x, object y)

{

return y.ToString().CompareTo(x.ToString());

}

}

       DirectoryInfo di = new DirectoryInfo(“FolderPath”);
       ArrayList dirArr = new ArrayList(di.GetDirectories());
       dirArr.Sort(new DirComparer());  

 

IComparer Interface :  

This interface is used in conjunction with the Array.Sort and Array.BinarySearch methods. It provides a way to customize the sort order of a collection. See the Compare method for notes on parameters and return value.

The default implementation of this interface is the Comparer class. For the generic version of this interface, see System.Collections.Generic.IComparer<T>.

 


排行榜 更多 +
翌日波奇狗的历险记手机版下载

翌日波奇狗的历险记手机版下载

休闲益智 下载
怪兽远征安卓版下载

怪兽远征安卓版下载

角色扮演 下载
谷歌卫星地图免费版下载

谷歌卫星地图免费版下载

生活实用 下载