谁有《Visual C# 2005 全程指南》光盘实例下载?(100分)

B

bbscom

Unregistered / Unconfirmed
GUEST, unregistred user!
谁有《Visual C# 2005 全程指南》光盘实例下载?
急... 在线等待... 下载后马上加分....
 
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace 使用SortedList
{
class Program
{
static void Main(string[] args)
{
SortedList grade = new SortedList();
grade["张三"] = 85;
grade["李四"] = 87;
grade["王五"] = 77;

// SortedList类具有自动排序功能,但下列数据并没有排序是怎么会事?
foreach (System.Collections.DictionaryEntry element in grade)
{
string name = (string)element.Key;
int grades = (int)element.Value;
System.Console.WriteLine("姓名:{0},成绩:{1}", name, grades);
}
System.Console.ReadKey();
}
}
}
 
MSDNLibrary上面不是就有吗?
记得在那上面看过,
 
以下程序来自于MSDN,修改了一下,通过VS2005运行
using System;
using System.Collections;
using System.Text;
namespace sortlist
{
class Program
{
static void Main(string[] args)
{
// Creates and initializes a new SortedList.
SortedList grade = new SortedList();
grade.Add("张三",85);
grade.Add("李四",87);
grade.Add("王五",77);
// Displays the properties and values of the SortedList.
Console.WriteLine("grade");
PrintKeysAndValues(grade);
Console.ReadLine();
}
public static void PrintKeysAndValues(SortedList myList)
{
Console.WriteLine("/t-KEY-/t-VALUE-");
for (int i = 0;
i < myList.Count;
i++)
{
Console.WriteLine("/t{0}:/t{1}", myList.GetKey(i), myList.GetByIndex(i));
}
Console.WriteLine();
}
}
}
 
你帮我找《Visual C# 2005 全程指南》光盘代码吗?
 

Similar threads

回复
0
查看
678
不得闲
D
回复
0
查看
676
DelphiTeacher的专栏
D
D
回复
0
查看
663
DelphiTeacher的专栏
D
D
回复
0
查看
615
DelphiTeacher的专栏
D
顶部