【发布时间】:2014-10-28 04:15:56
【问题描述】:
每次我尝试运行时,红色下划线“new Software(name, ID, newPath);”有人知道怎么修这个东西吗?
public Software addSoftware()
{
Console.WriteLine("Enter the name of the application");
string name = Console.ReadLine();
Console.WriteLine("Enter the ID");
int ID = Convert.ToInt32(Console.ReadKey());
Console.WriteLine("Enter the full path");
string newPath = Console.ReadLine();
Software newSoftware = new Software(name, ID, newPath);
return newSoftware;
}
【问题讨论】:
-
检查参数的顺序,第一个参数应该是int,第二个参数是一个字符串。
标签: c#