none
How to I use vb.net to find out when a webpage was created? RRS feed

  • Question

  • I have a program which, given a web-page, can give a list of webpages linked to by that page.   I would also like to be able to tell the user when those pages were created, or if that is impossible, when they were last updated.

    I found out that I cannot use the httpwebresponse.lastModified property, because that just tells you when the response happened when you interrogated the web-page.   It tells you nothing about the web-page itself.

    Is there a way to look at response headers and find out?

    Or some other way?

    Thursday, September 26, 2019 1:49 PM

Answers

  • What first comes to mind is that

    • A web page may be dynamically created each time a request is made (how I write web applications),
    • The page physical file does not change, it's a template were as above the page is dynamic.

    Given the above there is no sure fire method to know when a page was created vs using a page template.

    I mocked up an example and note the JQuery and templating is one way to template but with the actual data in a .js file.

    https://dojo.telerik.com/@karenpayneoregon/iZIKArAr



    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Gidmaestro Friday, September 27, 2019 8:16 AM
    Thursday, September 26, 2019 2:21 PM
    Moderator
  • Strange, 

    I was sure I've sent a message 4 hours ago. But maybe I made a mistake. 

    To get information about a web page is very easy with .Net, there are 2 verstions, TheHTTPClient and TheWebClient

    Here the information around the webclient (sample code is on that page) if you see the properties it should be easy.

    https://docs.microsoft.com/en-us/dotnet/api/system.net.webclient?view=netframework-4.8


    Success
    Cor

    • Marked as answer by Gidmaestro Friday, September 27, 2019 8:16 AM
    Thursday, September 26, 2019 10:04 PM

All replies

  • What first comes to mind is that

    • A web page may be dynamically created each time a request is made (how I write web applications),
    • The page physical file does not change, it's a template were as above the page is dynamic.

    Given the above there is no sure fire method to know when a page was created vs using a page template.

    I mocked up an example and note the JQuery and templating is one way to template but with the actual data in a .js file.

    https://dojo.telerik.com/@karenpayneoregon/iZIKArAr



    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Gidmaestro Friday, September 27, 2019 8:16 AM
    Thursday, September 26, 2019 2:21 PM
    Moderator
  • Strange, 

    I was sure I've sent a message 4 hours ago. But maybe I made a mistake. 

    To get information about a web page is very easy with .Net, there are 2 verstions, TheHTTPClient and TheWebClient

    Here the information around the webclient (sample code is on that page) if you see the properties it should be easy.

    https://docs.microsoft.com/en-us/dotnet/api/system.net.webclient?view=netframework-4.8


    Success
    Cor

    • Marked as answer by Gidmaestro Friday, September 27, 2019 8:16 AM
    Thursday, September 26, 2019 10:04 PM
  • Karen,

    Your answer is that there is no way to find out.   I did not understand the reason for the file with the template (what is that?) and JavaScript.

    Thanks.

    Gideon

    Friday, September 27, 2019 8:16 AM
  • Hi,

    Directory.GetLastWriteTime 

    Directory.GetCreationTime 

    Maybe you can try to use the above two functions to read and write the file directly.

    Hope it will be helpful.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 27, 2019 8:41 AM
    Moderator