StreamReader reader=new StreamReader(Application.StartupPath+"
\\abc.txt");
string str="";
int i=0;
while((str=reader.ReadLine())!=null)
{
i++;
}
string[] strarray=new string[i];
reader=new StreamReader(Application.StartupPath+"
\\abc.txt");
for(int j=0;j<strarray.Length;j++)
{
strarray[j]=reader.ReadLine();
}
foreach(string s in strarray)
{
MessageBox.Show(s);
}