find create and last modified date of web page

Hi

In a windows application .net c# I'm looking to find both the create and last modified date of a website page.

Any help please.
rgds
stephen
stephenwildeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

djon2003Commented:
Using the FileInfo class on the specific file you get use :
FileInfo fi = new FileInfo(filePath);
Date lastModifiedDate = fi.LastWriteTime;

Open in new window


http://msdn.microsoft.com/en-US/library/system.io.fileinfo_members(v=VS.80).aspx 
0
stephenwildeAuthor Commented:
Thanks

Will that work for a web page e.g. http://www.experts-exchange.com/aboutus.php?

Plus what about the original creation date?

Rgds
stephen  
0
djon2003Commented:
You were talking about external sites ? Not yours ?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

stephenwildeAuthor Commented:
Yes other websites, to monitior how often updates are performed.

This will be run from a Windows .net c# application on a looped thread.

Rgds
stephen
0
djon2003Commented:
Now, you have to read into the http response headers to see if the header Last-Modified exists and then you will get the date.
Imports System
Imports System.IO
Imports System.Net
Module Module1
    Sub Main()
        'Address of URL
        Dim URL As String = "http://www.internic.com"
        Dim request As HttpWebRequest = WebRequest.Create(URL)
        Dim response As HttpWebResponse = request.GetResponse()
        Console.WriteLine(response.GetResponseHeader("Last-Modified"))
        Console.ReadLine()

    End Sub
End Module

Open in new window

This code is written in VB, though really simple to translate.

The site in the code works. Though, testing with google.com and yahoo.com doesn't give me anything.
0
stephenwildeAuthor Commented:
Thanks for a solutiuon

But are there any other ideas out there that would give a better success rate?
0
djon2003Commented:
I am quiet sure you won't find. The reason is simple: this information is only known by a website owner. So each owner can decide if they share with you this information or not.

Though, a solution could merely work. Downloading the page a first time which you associate today's date. After then, on periodic spot, you download the page again and compare if it has changed. If so, you change the associated date.
This method would only works (with whole compare between files) with static pages. Dynamic pages have to be think differently. A possible way would be to get the HTML once the page is loaded. Though, would you want to consider an ad change as a "real" page change. Probably not. So then, you shall have inspect the page to compare only parts which a relevant to page modification. I think, as you see, that it's starting to be quiet difficult and a long labor.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stephenwildeAuthor Commented:
Thank you - sometimes code cannot provide the solution!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.