How to get last modified date of the webpage? [duplicate]
I want to know how to get last modified date of the webpage using c#...?
I tried the below code but I get only date as 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.
According to this your method should work. Maybe the page was actually modified today?
Also looking at this response here it is up to the HTTP server to set the Last-Modified response header. So if the server does not set the field correctly you can't rely on it.
精彩评论