/**
* Get the webpage Update Time
* Enter the webpage URL
* Returns the webpage Update Time string.
*/
Private string getupdatetime (string strurl ){
String strtime = NULL;
Url hp;
Urlconnection hpcon = NULL;
Try {
HP = new URL (strurl );
Hpcon = hp. openconnection ();
} Catch (malformedurlexception e ){
// Todo automatically generates catch Blocks
E. printstacktrace ();
Return "error ";
} Catch (ioexception e ){
// Todo automatically generates catch Blocks
E. printstacktrace ();
Return "error ";
}
Date = new date (hpcon. getlastmodified ());
Long n = date. gettime ();
If (n = 0 ){
Return NULL;
}
Strtime = date. tostring ();
Return strtime;
}
The purpose of writing this function is to check whether the webpage is updated. If there is an update, download it to the local device; otherwise, 54. However, this function obtains the webpage Update time through the HTTP header. If the webpage's HTTP header does not contain lastmodified, there is no way to get the webpage update information. Is there any way to ensure that, without downloading a webpage, 100% detects any updates to a webpage? Also hope high hand guidance.