开发者

How to get last modified date of the webpage? [duplicate]

This question already has answers here: 开发者_开发知识库 HttpWebResponse LastModified (2 answers) Closed 2 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜