-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathProgram.cs
More file actions
121 lines (101 loc) · 4.49 KB
/
Program.cs
File metadata and controls
121 lines (101 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.IO;
using System.Net;
namespace HalloGitHub
{
class Program
{
private static readonly string octocatAsciiArtUrl = @"https://raw.githubusercontent.com/pi314/ascii-arts/master/octocat.asciiart";
static void Main(string[] args)
{
Console.WriteLine("Ich weiß es ist nicht der Hammer, aber trotzdem:");
Console.WriteLine("Hallo GitHub".ToUpper());
Console.WriteLine();
Console.WriteLine("Spannender wird es im GitHub-Projekt: LMStudent/hallo-octocat"+" oder auf LenrMoment.de");
Console.WriteLine();
Console.WriteLine("Oder kannst du mir sagen in welcher Lektion des Udemy-Kurses");
Console.WriteLine("'Einstieg in GitHub - professionelle Entwicklung im Team'");
Console.WriteLine("dieses Projekt zu erst verwendet wird? Mit der richtigen Antwort ");
Console.WriteLine("bekommst du noch ein wenig ASCII-Art von pi314 in deine Konsole!");
Console.WriteLine("TIP: Schaue in der Kursbeschreibung oder im Quellcode nach ;-)");
Console.WriteLine();
Console.Write("Antwort: ");
if (HoleAntwortVomBenutzer() == 14)
{
string asciiArt = LadeAsciiArtVomServer(octocatAsciiArtUrl);
Console.WriteLine(asciiArt);
Console.WriteLine();
Console.WriteLine("ASCII-Art aus dem GitHub-Verzeichnis: pi314/ascii-arts - DANKE an pi314!!!");
}
else
{
Console.WriteLine("Schade, dass war nicht die richtige Antwort.");
}
ZeigeAbspann();
Console.WriteLine("Drücke RETURN zum beenden.");
Console.ReadLine();
}
private static int HoleAntwortVomBenutzer()
{
string antwort = Console.ReadLine();
int antwortAlsZahl = 0;
int.TryParse(antwort, out antwortAlsZahl);
return antwortAlsZahl;
}
private static string LadeAsciiArtVomServer(string url)
{
string asciiArt = string.Empty;
var webRequest = WebRequest.Create(url);
using (var response = webRequest.GetResponse())
using (var content = response.GetResponseStream())
using (var reader = new StreamReader(content))
{
asciiArt = reader.ReadToEnd();
}
return asciiArt;
}
private static void ZeigeAbspann()
{
Console.WriteLine();
Console.WriteLine("ABSPANN - Am Kurs haben bisher teilgenommen:");
Console.WriteLine(" - LMStudent");
Console.WriteLine(" - Evendur");
Console.WriteLine(" - suchja");
Console.WriteLine(" - s7git"); //second Pull Request change
Console.WriteLine(" - TBone89");
Console.WriteLine(" - Klatoo");
Console.WriteLine(" - Lopi-Of");//zweiter PULL REQUEST
Console.WriteLine(" - CeeeJay");
Console.WriteLine(" - Kaivdp"); //Neuer PULL
Console.WriteLine(" - max4040");
Console.WriteLine(" - ringerob");
Console.WriteLine(" - Tachigro"); //Tachi was here
Console.WriteLine(" - Zollma");
Console.WriteLine(" - klochden");
Console.WriteLine(" - blauber");
Console.WriteLine(" - stepweII");
Console.WriteLine(" - dannypilz");
Console.WriteLine(" - wjsteiner");
Console.WriteLine(" - mklimenta"); //zweiter PULL REQUEST
Console.WriteLine(" - rudi64");
Console.WriteLine(" - StefanRieger");
Console.WriteLine(" - SirHenry34");
Console.WriteLine(" - holginaut");
Console.WriteLine(" - delinklink");
Console.WriteLine(" - ElbPsi");
Console.WriteLine(" - felixdittrich92");
Console.WriteLine(" - nicolibi");
Console.WriteLine(" - Zak McKracken");
Console.WriteLine(" - hannesa7x");
Console.WriteLine(" - Confectix");
Console.WriteLine(" - DenisGeist");
Console.WriteLine(" - Lenzelott");
Console.WriteLine(" - RedLenco");
Console.WriteLine(" - MK-NEUKO");
Console.WriteLine(" - AndresRedondo87");
Console.WriteLine(" - fwesselmann")
// Kopiere die vorherige Zeile und verwende deinen Namen anstelle von LMStudent.
Console.WriteLine();
}
}
}