私はコーディングしていますが、C#で問題があります。私は、次のコードを持っている:押されたキーを取得し、次の読み込み文字列に追加します。
if (Console.ReadKey(true).KeyChar.ToString() == "l") // Reading single key in console
goto load;
// If not, continue
// Here, if I didn't press "l", I have to press the key once more, because at first, it checked it in if statement above so it is reding this into the string on the second time. So just want that if I didn't press "l" Automatically add that key to string below
string read = Console.ReadLine();
問題は、私は「L」最初の文字を押してしたくない場合は、私は何か他の2回押さなければならないということです。 (最初のプレスがConsole.ReadKey()をチェックしているので) "l"以外のキーを押すと、自動的に以下のConsole.ReadLineに書き込まれます。ありがとう
お持ちの場合は、 '後藤'あなたのコードでは、もっと多くの問題があるようになっています – UnholySheep
@UnholySheepは既に彼に言いましたが、.... – Steve
の代わりに' goto'ステートメントを使わないでください。 –