【发布时间】:2010-10-19 22:06:56
【问题描述】:
我有一个学生/作业对列表,通过平面文件进入我的应用程序到一个 List 对象中,我想根据作业列表验证这些作业名称,我必须查看哪个学生做了什么分配(如果有的话)。
所以 - 我有一个学生列表、一个学生/作业对列表和一个作业列表。
我想创建如下输出:
1.(标题)--学生姓名--作业一--作业二 2.(详细)--约翰·史密斯----我怎样才能做到这一点?
到目前为止我所拥有的: // HACCStudentBlogs 将学生列表存储在字典中 //
Dictionary<string, string> studentBlogs = new Dictionary<string, string>();
foreach (JObject o in root)
{
createDate = (string)o["createdDate"];
studentName = (string)d[(string)o["contributorName"]];
submittedStudents.Add(studentName);
title=(string)o["title"];
if (HACCstudentBlogs.ContainsKey(studentName))
{
HACCstudentBlogs[studentName] += "\t" + title.ToUpper();
}
else
{
}
}
【问题讨论】:
-
一点源代码会很有用。我建议使用 LINQ。
-
学生和作业?这似乎是家庭作业,应该这样标记。
-
情绪低落的男孩 -- 我在学术界工作,并有一个学生评分系统作为我工作的一部分。
标签: c# arrays list dictionary