Notes from Daily Encounters with Technology RSS 2.0
 
# Thursday, September 07, 2006

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.

Thursday, September 07, 2006 11:41:34 PM (Central European Daylight Time, UTC+02:00)  #    Comments [1] - Trackback
Development | .NET
Friday, September 08, 2006 7:04:28 PM (Central European Daylight Time, UTC+02:00)
Oh my god. Our own people!?
Comments are closed.
Sponsored Ads

About Me
Twitter
Potepanja v naravi: Abram na Nanosu http://t.co/vtlUEWJg 34 minutes ago
@MladenPrajdic @andrejt use the middle mouse button then 2 days ago
Great #DotNetRocks show: Troy Hunt Secures http://t.co/oxClbXLe http://t.co/MiMasNuZ PDF is worth checking out as well http://t.co/z4BHAzqh 3 days ago
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

All Content © 2012, Damir Arh, M. Sc. Send mail to the author(s) - Privacy Policy - Sign In
Based on DasBlog theme 'Business' created by Christoph De Baene (delarou)
Social Network Icon Pack by Komodo Media, Rogie King is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.