මචංලා programming දන්න යාලුවන්ගෙන් මට පොඩි උදව්වක් ඕනි...මේකයි එක case එක.
මට ඕනි text file එකක් read කරල arraylistඑකකට දාගන්නග.ඊට පස්පෙ එකread කරන්නයි ඕනි මේ මගෙ code එක..දන්න එක්කෙනෙක් ඉන්නවනම් පොඩි උදව්වක් දෙන්නකො....
String[] lines = new String[100];
String path = Server.MapPath("~\\Resarch\\new.txt");
StreamReader sre = new StreamReader(path);
string line = "";
try{
line=sre.ReadLine();
while(line!=null)
{
lines.Add(line);
line =sre.ReadLine();
}
sre.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
sre.Close();
}
foreach (string s in lines)
{
TextBox1.Text=lines;
}
}
}
මට ඕනි text file එකක් read කරල arraylistඑකකට දාගන්නග.ඊට පස්පෙ එකread කරන්නයි ඕනි මේ මගෙ code එක..දන්න එක්කෙනෙක් ඉන්නවනම් පොඩි උදව්වක් දෙන්නකො....
String[] lines = new String[100];
String path = Server.MapPath("~\\Resarch\\new.txt");
StreamReader sre = new StreamReader(path);
string line = "";
try{
line=sre.ReadLine();
while(line!=null)
{
lines.Add(line);
line =sre.ReadLine();
}
sre.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
sre.Close();
}
foreach (string s in lines)
{
TextBox1.Text=lines
}
}
}