Homework and exercises are set by tutors to help you learn. They give you an opportunity to apply and practise the techniques you are being taught.
So, even if you had actually asked a question, we will not do your homework for you. It really would not help you at all.
Hints: The code you have posted reads the file, but you are not doing anything with the list of lines nor are you comparing the contents of each line to anything.
Keep trying, write the rest of the code and come back if you get stuck.
[EDIT - adding more hints as the OP has taken their code a bit further]
As I'm going to suggest that you examine values of things you are going to find this article useful:
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]
You have taken the advice of @F-ES_Sitecore and used
Split
to get the individual components of each line. If you put a breakpoint on the line
for (int j = 0; j <= stt.Length; j++)
and examine your array
stt
you will notice that for all the lines
stt[0] contains the Server name - Server1, Server2, etc
stt[1] contains the "type" - Database, OS, Language
stt[2] contains the name of the actual thing of type stt[1] - MySQL, Ubuntu, Python
stt[3] contains the version number
So you don't really need that for-loop using
j
, you can just look directly at the exact location for the information you are going to check against.
You already have a Dictionary defined
latestVersion
but you need to populate that, probably using the
Add method[
^]. Just hard-code the values for now until you get something working.
For each line you are going to want to "lookup"
stt[2]
in your dictionary and compare
stt[3]
with the value in the dictionary. If they don't match then this server (
stt[0]
) needs to be added to your output. I suggest using the
TryGetValue method[
^]
Give that a go and see how you get on