How to get the last modified date of a web page in C #?

I want to know how to get the last modified date of a webpage using C # ...?

I tried the code below, but I only get the date like today

HttpWebRequest req =(HttpWebRequest)WebRequest.Create("http://www.codeproject.com/KB/cs/youmanager.aspx");
HttpWebResponse res =(HttpWebResponse) req.GetResponse();
DateTime  abcd = res.LastModified;

Thanks in advance.

+3
source share
1 answer

According to this, your method should work. Maybe the page was actually resized today?

Also looking at this answer here , the HTTP server should set the Last-Modified response header. Therefore, if the server did not set the field correctly, you cannot rely on it.

+1
source

All Articles