Determine Homepage content change

  • Thread starter Thread starter Macneed
  • Start date Start date
M

Macneed

I want to write a code to determine the homepage content was change,
but if the homepage is write by asp or something else, (e.g. livescore.com
here)
i can't get the real homepage content by the following code,
what can i do?
if it is not related to c#
which newsgroup should i post to?

using System;
using System.Net;
using System.IO;
using System.Collections.Generic;
using System.Text;

namespace Web
{
class Program
{
static void Main(string[] args)
{
string RateHTML = "";
string tempHTML = "";

for (int i = 0; i < 10; )
{

try
{
// Download the data to a buffer.
WebClient client = new WebClient();

Byte[] RateHP =
client.DownloadData("http://www.livescore.com/default.dll?page=home");
RateHTML = Encoding.ASCII.GetString(RateHP);

// Download the data to a file.
client.DownloadFile("http://www.livescore.com/default.dll?page=home",
"check.txt");
}
catch (WebException webEx)
{
Console.WriteLine(webEx.ToString());
if (webEx.Status == WebExceptionStatus.ConnectFailure)
{
Console.WriteLine("Are you behind a firewall? If
so, go through the proxy server.");
}
}

DateTime TimeNow = DateTime.Now;
if (tempHTML != RateHTML)
{
Console.WriteLine("Score change {0,1}:{1,2}{2,5}",
TimeNow.Minute % 10, TimeNow.Second, TimeNow.Millisecond);
tempHTML = RateHTML;
}
else
{
Console.WriteLine("Unchange {0,1}:{1,2}{2,5}",
TimeNow.Minute % 10, TimeNow.Second, TimeNow.Millisecond);
}

i++;
}
} // end Main
}
}
 
Macneed said:
I want to write a code to determine the homepage content was change,
but if the homepage is write by asp or something else, (e.g. livescore.com
here)
i can't get the real homepage content by the following code,
what can i do?
if it is not related to c#
which newsgroup should i post to?

Hi Macneed,
if the remote page is dynamic you cannot get header "Last-Modified".
The unique way I'm finding now is to parse the page and find a specific
section to check if has changed (in contents or length).
I'm not sure it's a legal way..

Try to checkout
microsoft.public.dotnet.framework.aspnet
or
microsoft.public.dotnet.framework.remoting


Bob
 
Back
Top