Results 1 to 1 of 1

Thread: [RESOLVED] Help needed, error using WebClient

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    258

    Resolved [RESOLVED] Help needed, error using WebClient

    Okay, I've got a class I wrote a while back to download files using WebClient. It worked under XP when I wrote it and used it. Now I'm using it under Windows 7 for the first time, and I'm getting an error when I try to download. The string URL contains, of all things, the complete URL for the file I'm trying to download. It exists... I placed it there myself and can access it via browser. The string Location contains the destination directory, which in this case is "C:\Test".

    Code:
    Dim WC As New WebClient
    WC.DownloadFile(URL, Location)
    When this code runs, it fires off an exception, the meat of which is this:

    InnerException: System.UnauthorizedAccessException
    Message=Access to the path 'C:\Test' is denied.

    I've checked the directory, and it has security privs for all users set to full access. Does anybody have any idea what I'm missing here? This isn't a problem with the download itself, I think it's bumping into Windows 7 issues that I didn't have to worry about in Windows XP.

    NOTE: the directory is empty, so it shouldn't be running into read-only issues of the files in the folder.

    Any thoughts?

    UPDATED: Okay, I figured this out. It was a stupid error... I didn't include the file name along with the destination directory. Fixed that, and it worked fine.
    Last edited by HongKongCV; Jun 13th, 2012 at 02:16 PM. Reason: Added information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width