这是我的密码.只需编写一个简单的程序来练习字符串及其方法.我无论如何也不能让控制台读取我想存储在变量"myNameFirst"中的"Console.ReadLine()".
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter a string here and press enter.");
string user = Console.ReadLine();
Console.WriteLine("Now enter a character to search for:");
char userChar = (char)Console.Read();
Console.WriteLine($"The index of the letter {userChar} is {user.IndexOf(userChar)}");
Console.WriteLine("What is your first name?");
string myNameFirst= Console.ReadLine();
Console.WriteLine(myNameFirst);
}
}
}
我重新启动了我的计算机,我重新安装了Visual Studio,我判断了一下,以确保没有打字错误.我还搜索了其他问题,似乎没有人知道如何跳过这些问题来修复游戏机.