Downloading a file

RobinTibbs

Member
Joined
Nov 8, 2006
Messages
18
Programming Experience
Beginner
ok so the point of my program is to keep a warcraft mod updated, to do this i must get the contents of a text file which contain the latest version (solved) then download the appropriate file (named BigWigsxxxxx.zip) where xxxx is the latest version.

VB.NET:
  Private Sub bwu_downloadLatest()
        Dim wowpath As String = bwu_getWoWPath()
        Dim wc As New System.Net.WebClient()
        Try
            wc.DownloadFile("http://wowace.com/files/BigWigs/BigWigs" + bwu_GetLatestVersion() + ".zip", wowpath + "\Interface\Addons\BigWigs")
        Catch WEx As Exception
            TextBox1.AppendText("Put something more meaningful here")
        End Try
    End Sub
now im pretty sure the above code is right, however when downloading the file i get an UnauthorizedAccessException stating i dont have permission to write the file. Now I'm wondering if it's a permissions issue or a coding issue? Thanks :)
 
Hi,

Using

VB.NET:
wc.DownloadFile("http://download.nullsoft.com/winamp/client/winamp531_lite.exe", "c:\winamp.exe")
Works for me, so the usage seems ok... Have you tried using static paths to check its going to the correct location?

Try c:\ or where you have Dim wowpath As String = bwu_getWoWPath() , you could try replacing bwu_getWoWPath() with "my path"



Hope it helps :)
 
Back
Top