Previously with .net visual studio 2010 I made this code below a script language to play with her idea was as follows

read from the txt file the highlighted word in the case below echo and cut the word echo and get the next ones and put it in the variable RUN

so print, but for some reason my code does not work in .net core is there any specific reason?

HTML Code:
 For Each line As String In System.IO.File.ReadLines(sfilename)
            ' Display the line.
            Dim execommand = line.ToString
            Dim run As String
            If execommand = "echo" Then
                run = execommand.Split.ToString(1)
                MsgBox(run)
            End If
        Next