Archiv verlassen und diese Seite im Standarddesign anzeigen : ja/nein Abfrage
Valigarmanda
16.11.2006, 14:13
Wenn ich ihn C# bei einer Konolenanwendung eine j/n Abfrage mache, muss man z.B. "j" eintippen und Enter tippen. Kann man es irgendwie machen, dass man nur "j" eintippen muss und dann geht es automatisch weiter?
Lucleonhart
16.11.2006, 14:38
Hm.. ich würd vorschlagen:
Console.Write("Ja oder Nein?");
ConsoleKeyInfo eingabekey = Console.ReadKey();
if (eingabekey.Key == ConsoleKey.J)
{
// Ja
}else{
// Anders. ^^
}
Valigarmanda
16.11.2006, 17:10
Danke, das müsste gut funktionieren.
Powered by vBulletin® Version 4.2.3 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.