You read all the data from the file, and then try to read a single line:
Streamreader s = new Streamreader();
string d = s.ReadToEnd();
string e ;
string line = "";
while ((line = s.ReadLine())!=null)
And the use of meaningless single character names for your variables does not help.