So, I’ve been working on this for a month, but I haven’t found anything on the network, so although it’s possible that every minute you can check the changes in the source code of websites, it seems that the source code changes every second, so are there any Is there any problem in my coding or is there another way to track website changes?
here is my code:
private void Startbtn_Click(object sender, EventArgs e) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader source = new StreamReader(response.GetResponseStream()); richTextBox1.Text = source.ReadToEnd(); timer1.Start(); timer1.Interval = 60000; } private void timer1_Tick(object sender, EventArgs e) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader source2 = new StreamReader(response.GetResponseStream()); RichTextBox checker = new RichTextBox(); checker.Text = source2.ReadToEnd(); if (richTextBox1.Text == "") { richTextBox1.Text = checker.Text; } else { if (richTextBox1.Text != checker.Text) { MessageBox.Show("somthing changed"); richTextBox1.Text = checker.Text; } else { MessageBox.Show("No changes yet!"); } } }
source share