Advertisement
Guest User

Untitled

a guest
Nov 14th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public void start()
  2. {
  3. while (choice != 0)
  4. {
  5. try
  6. {
  7. choice = int.Parse(Console.ReadLine());
  8. }
  9. catch (Exception e)
  10. {
  11. todo: skriv exception
  12. start();//kör om startmetoden
  13. }
  14.  
  15. switch (choice)
  16. {
  17.  
  18. case 1:
  19. //gör något
  20. break;
  21.  
  22. case 2:
  23. //gör något
  24. break;
  25.  
  26. case 0://avslutar programmet
  27. Environment.Exit(0);
  28. break;
  29.  
  30. }
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement