Student firstStudent;
firstStudent = new Student
你这个Student 从哪里来的????
C#里面有这个明明空间吗???
还是他是一个你自己设计的,如果是你自己设计的话
在最上面加上一句“using 工程名称.....Student”
这样应该就没问题了、
你写的很乱 。。。 建议这样写:
class student
{
名字 出生日期 ID
}
Student firstStudent;
firstStudent = new Student();
firstStudent.Name = "关羽";
firstStudent.BirthDay = new DateTime(1990, 1, 2);
firstStudent.StudentID = "140407";
Student anotherStudent;
anotherStudent = new Student();
anotherStudent.Name = "张飞";
anotherStudent.BirthDay = new DateTime(1996, 2, 3);
anotherStudent.StudentID = "123123";
Console.WriteLine("{0} 号学生{1}出生日期:{2}", firstStudent .StudentID, firstStudent .Name,
firstStudent .BirthDay);
不知道写的怎么样,你可以参考下
你要定义一个Student类,里面包含Name、BirthDay、StudentID 属性
凑数
没有student类