How can i compare a string content each n seconds adter a new content have been downloaded?
<p>I have this code :</p>

<pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            while (true)
            {

                if ((worker.CancellationPending == true))
                {
                    e.Cancel = true;
                    break;
                }
                else
                {



                    string content = downloadContent();
                    if (InvokeRequired)
                    {
                        BeginInvoke(new Action(() =&gt; textBox1.Text = content), null);
                    }

                    GetProfileNames(content);
                    GetTextFromProfile(content);


                    reader.Close();
                    response.Close();
                    Thread.Sleep(30000);
                }
            }
        }
</code></pre>

<p>And the downloadContent function:</p>

<pre><code>private string downloadContent()
        {
            WebRequest request = WebRequest.Create(testingUrl);
            request.Method = "GET";
            response = request.GetResponse();
            Stream stream = response.GetResponseStream();
            reader = new StreamReader(stream);
            string content = reader.ReadToEnd();
            return content;
        }
</code></pre>

<p>I need that every 30 seconds it will download a new content like it does now, store the old content one before and compare the new download with the one before downloaded content.</p>

<p>If they are identical dont do anything if they are not identical do something.</p>
