Hey,
ich hatte folgendes programmiert:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
| static void Main(string[] args) { int zahl = 1; while(zahl<=100)
{ int rechnen; rechnen= zahl*zahl; console.WriteLine(zahl); console.ReadLine zahl++; } |
Plötzschlich, nach 100x maligen "Enter" drücken stürtzt visual c# ab!
Dann öffne ich die datei nochmal, und was passiert?!
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| static void Main(string[] args) { int zahl = 1; string text = Console.ReadLine(); if (int.TryParse(text, out zahl)) ; else { Console.WriteLine("Hallo"); Console.ReadLine(); } |
Das steht dan drin!
Merkwürdig!
Moderiert von
Th69: Titel geändert.Moderiert von
Th69: Topic aus C# - Die Sprache verschoben am Sa 17.09.2011 um 08:22
_________________
Der Pc ist nur so schlau, wie derjenige der in steuert!
"Don't Quit. Suffer now, and live the rest of your life as a champion"