I am downloading an http file from an ftp server of mine. This file holds the version number for my application, and as such is updated when a new version of my application is released to the public.
Currently, the file being downloaded is not the latest file on the webserver, and is an old file. I am guessing that this is because an old version of the file exists as a cached file.
Can someone have a quick look at my code to see why I am not getting the latest version.
Here is my code:
Currently, the file being downloaded is not the latest file on the webserver, and is an old file. I am guessing that this is because an old version of the file exists as a cached file.
Can someone have a quick look at my code to see why I am not getting the latest version.
Here is my code:
Code:
Public Function GetWebFile(WebAddress As String) As String
Try
Dim WebClientForApplicationVersion As New System.Net.WebClient
WebClientForApplicationVersion.CachePolicy = New System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore)
Dim ApplicationVersionInformation As String = WebClientForApplicationVersion.DownloadString(WebAddress)
Return ApplicationVersionInformation
Catch ex As Exception
Return "Error"
End Try
End Function