如何排序 array 为Control数组,Array.Sort(array, 0, array.Length,IComparer);IComparer要怎样写?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class IntComparer : IComparer<int> { public int Compare(int x, int y) { return y-x; } } class Program { static void Main(string[] args) { int[] arr = { -32, -10, 33, -23, 32, -12, 41, -12, 12 }; Array.Sort(arr, new IntComparer()); foreach (int i in arr) Console.WriteLine(i); Console.ReadLine(); }} array = array.OrderBy(x => x.属性).ToArray(); 怎么在c#Form窗口里实现显示批量缩略图形式的图片 关于用正则匹配HTML指定的内容 asp.net 压缩文件夹问题 如何得到datagrid中单元格的内容呢? 求C#中给datagridview中每行加个倒计分钟 一个窗体有两个按纽,“是”“否”,运行后怎么样把焦点定在否上 脚本错误,如何解决 MSMQ怎样用啊? 自己开发小工具遇到的问题 在Winfrom中设置WebBrowser控件滚动条位置在最底端 String转二进制输出 ConfigurationManager.ConnectionStrings["test"].ConnectionString调试的时总是出现未将对象引用到实例
public class IntComparer : IComparer<int>
{
public int Compare(int x, int y)
{
return y-x;
}
}
class Program
{
static void Main(string[] args)
{
int[] arr = { -32, -10, 33, -23, 32, -12, 41, -12, 12 };
Array.Sort(arr, new IntComparer());
foreach (int i in arr)
Console.WriteLine(i);
Console.ReadLine();
}
}