Check if file exists at url..

and if the file exists then it would bring up a message box with Ok and Cancel and asking do you want to start the download for this file.
 
Yes, look into the System.Net.HttpWebRequest and System.Net.HttpWebResponse functions.

I dont have a sample of checking if a URL file exists, but this snippet might help.

Code:
Imports System.Net

Dim installedDate, onlineDate As Integer
Dim wRequest As HttpWebRequest = HttpWebRequest.Create("http://www.myURL.com/myFile.exe")
Dim wResponse As HttpWebResponse = wRequest.GetResponse

installedDate = CInt(File.GetLastWriteTime(Application.StartupPath & "\myFile.exe").ToOADate)
onlineDate = CInt(wResponse.LastModified.ToOADate)
wResponse.Close()

If onlineDate > installedDate Then
blah
End If
 
Back
Top