title: The process can not access the file because this file is used by another
body: <p>i have a file.log continually writing , i copy this file into my desktop with some script and i test if the a keyword is on the last lane on the log , if yes i show a green picture if not i show a red picture the probleme that when i start my program i get this error her is the code  </p>
  
  <pre><code>    {
  
          // File.ReadAllLines(@"C:\\Users\\Reta\\Desktop\\TEST\\TEST\\fichiers\\k20\\winvsrTEST.log").Last();
          // System.IO.StreamReader file = new System.IO.StreamReader(@"C:\\Users\\Reta\\Desktop\\TEST\\TEST\\fichiers\\k20\\winvsrTEST.log");
          string motcle1 = "oee code";
          //string line = File.ReadLine().Last().ToString();
          var lines = File.ReadAllLines(@"C:\Users\Reta\Desktop\TEST\TEST\fichiers\k20\winvsrTEST.log");
          string line = lines.Last();
  
  
          //line = File.ReadAllLine();
          //do
          {
              if (line.Contains(motcle1))
              {
  
                  pictureBox2.Show();
                  pictureBox1.Hide();
  
  
              }
              else
              {
                  pictureBox2.Hide();
                  pictureBox1.Show();
              }
  
  
          }
          //while ((line = File.ReadLine()) != null);
          label1.Text = "Hi";
  
      }
  }
  </code></pre>
  
  <p>}`</p>