Get FileInfo of a file on server

1.1k views Asked by At

I have a file with the following uri http://10.20.80.001/mobilepayment/hi.cer published in iis . Is there any way to get the date created of this file in vb?? I want something like this

Dim fullpath = http://10.20.80.001/mobilepayment/hi.cer
Dim infoReader As System.IO.FileInfo
infoReader = My.Computer.FileSystem.GetFileInfo(fullpath)
Dim Filetimestamp As String = infoReader.LastWriteTime.ToString("yyMMddHHmmss")

thanks!

1

There are 1 answers

2
SazooCat On

You need to actually GET the file from the URI. Until you've done that it is just a string.

So either perform a web request and download it to a temporary location, then use that location as your "fullpath" OR when you request it inspect the HTTP headers for the last modified date.