ddanbe is refering to his reply in your other thread:here.
Since you are posting them as seperate issues and ddanbe and diamonddrake have given you the code to read in the contents of the file i wont go over that. To split the string you can do something like:
As ddabe said, it is very hard for us to debug the code if we dont know the error. Lets us now the full message that is displayed so we can figure out what is causing it. Also, is the Console.WriteLine(line); definitely showing the right values? You have an errant whitespace in your filename...not sure if that will make a differance, but something to check :) StreamReader sw = new StreamReader("c:[U] [/U]\\key.txt");