retrieve file date and time for a Internet file

retrieve file date and time for a Internet file

Postby MOISES » Thu Jan 23, 2020 11:32 am

Hi,

Is it possible to obtain the date and time from a file in http://www.google.com/files/update.exe?

Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: retrieve file date and time for a Internet file

Postby MOISES » Thu Jan 23, 2020 11:39 am

Something like this:

Code: Select all  Expand view
Public Function GetRemoteFilenameTimestamp(ByVal address As Uri) As Date

            Dim request As System.Net.HttpWebRequest
            Dim response As System.Net.HttpWebResponse = Nothing
            Dim dat As Date

            Try
                ' Create the web request  
                request = DirectCast(System.Net.WebRequest.Create(address), System.Net.HttpWebRequest)

                '
Get response  
                response = DirectCast(request.GetResponse(), System.Net.HttpWebResponse)
                dat = response.Headers.Item("Last-Modified")

                'response.Headers.Item("Content-Length")

            Finally
                If Not response Is Nothing Then response.Close()
            End Try

            Return dat

        End Function
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests