PaperScrapper.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. 
  2. using System.Collections;
  3. using System.Runtime.InteropServices.Marshalling;
  4. class PaperScrapper
  5. {
  6. static void Main(string[] args)
  7. {
  8. String? userCase;
  9. int resultCount = 10;
  10. String strErrorUserCase = "Wrong option, try again";
  11. String uiMessage = @"
  12. 1 - Search by text
  13. 2 - Latest page
  14. 3 - Hot page
  15. 4 - Toplist page
  16. 5 - Random page
  17. 6 - Change result output.
  18. 0 - Exit";
  19. do
  20. {
  21. Console.WriteLine("Which option PaperScrapper should use:" + uiMessage);
  22. userCase = Console.ReadLine();
  23. switch (userCase)
  24. {
  25. case "1":
  26. SearchByText();
  27. break;
  28. case "2": break;
  29. case "3": break;
  30. case "4": break;
  31. case "5": break;
  32. case "6":
  33. Console.WriteLine("Current result output is "+ resultCount);
  34. Console.WriteLine("Input how many pictures do you want to download per request: ");
  35. int tmpResCount = resultCount;
  36. if (!int.TryParse(Console.ReadLine(), out resultCount))
  37. {
  38. resultCount = tmpResCount;
  39. Console.WriteLine("You must enter a number. Try again!");
  40. }
  41. break;
  42. case "7": break;
  43. default: break;
  44. }
  45. } while (userCase != "0");
  46. }
  47. private static void SearchByText()
  48. {
  49. Console.WriteLine("Input text: ");
  50. String? inputText = Console.ReadLine();
  51. }
  52. private static void ShowLatestPage()
  53. {
  54. }
  55. private static void ShowHotPage()
  56. {
  57. }
  58. private static void ShowRandomPage()
  59. {
  60. }
  61. }