|
Last modification time of a web page (Development | .NET)
The following code returns the time when a web resource was last modified:
static DateTime GetModificationTime(string url) { WebRequest request = WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); DateTime lastModified = response.LastModified; response.Close(); return lastModified; }
It’s quite a simple piece of code actually and very similar to a sample in MSDN. But maybe it will be useful to someone since a member of my developer team was convinced that there is just no way to get this information in .NET.
9/7/2006 10:41:34 PM (Central Europe Standard Time, UTC+01:00)
|