R
Ricardo Luceac
Hi all.
I'm having a problem with this, I have look if a file exists, if don't wait
till it is created and if it exists I need to open it. I do the following:
for (; ; )
{
if (fl.Exists)
{
StreamReader sr = fl.OpenText();
StreamWriter sw = new StreamWriter(FILE_NAME);
String line;
while ((line = sr.ReadLine()) != null)
{
if (!line.Contains("Pagina"))
sw.WriteLine(line);
}
sr.Close();
sw.Close();
}
}
The problem is that when it's checking if the file exists the cpu load is in
100%.
Is there a way to do that check once per second?? like an wait 1 second them
check it again??
Or any other method???
Thx..
I'm having a problem with this, I have look if a file exists, if don't wait
till it is created and if it exists I need to open it. I do the following:
for (; ; )
{
if (fl.Exists)
{
StreamReader sr = fl.OpenText();
StreamWriter sw = new StreamWriter(FILE_NAME);
String line;
while ((line = sr.ReadLine()) != null)
{
if (!line.Contains("Pagina"))
sw.WriteLine(line);
}
sr.Close();
sw.Close();
}
}
The problem is that when it's checking if the file exists the cpu load is in
100%.
Is there a way to do that check once per second?? like an wait 1 second them
check it again??
Or any other method???
Thx..