G
Guest
I would like to create a notepad-type appropriate text editor using CF.
I tried to open a file and read its content to a textbox using StreamReader:
try
{
using (StreamReader sr = File.OpenText(filename))
{
string line;
while ((line = sr.ReadLine()) != null)
{
text += line;
}
sr.Close();
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
theTextBox.Text = text;
Reading a 162kB long text file needs more then one minute. It is too slow.
ReadAllText method is not supported in CF (and not supported in OpenNetCF).
Is there a way to speed up the code snippet above?
Please help!
Frankie
I tried to open a file and read its content to a textbox using StreamReader:
try
{
using (StreamReader sr = File.OpenText(filename))
{
string line;
while ((line = sr.ReadLine()) != null)
{
text += line;
}
sr.Close();
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
theTextBox.Text = text;
Reading a 162kB long text file needs more then one minute. It is too slow.
ReadAllText method is not supported in CF (and not supported in OpenNetCF).
Is there a way to speed up the code snippet above?
Please help!
Frankie