C# 错误 1 找不到类型或命名空间名称“Student”(是否缺少 using 指令或程序集引用?)

2025-05-13 20:57:29
推荐回答(5个)
回答1:

Student firstStudent;
firstStudent = new Student
你这个Student 从哪里来的????
C#里面有这个明明空间吗???
还是他是一个你自己设计的,如果是你自己设计的话
在最上面加上一句“using 工程名称.....Student”
这样应该就没问题了、

回答2:

你写的很乱 。。。 建议这样写:
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);
不知道写的怎么样,你可以参考下

回答3:

你要定义一个Student类,里面包含Name、BirthDay、StudentID 属性

回答4:

凑数

回答5:

没有student类