Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8426319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:30:47+00:00 2026-06-10T04:30:47+00:00

My code is below. I’m trying to download a file, and my application gives

  • 0

My code is below. I’m trying to download a file, and my application gives me “filename Not Found – downloading” followed by “Finished” as a result of this code, but when I go and look no file has actually been downloaded.

    private void Form1_Load(object sender, EventArgs e)
    {
        download(@"mp3spi.jar", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\.minecraft\bin\lob\");
    }

    public void download(String filename, String path)
    {
        filenameLabel.Text = filename;
        MessageBox.Show(filename + " Not found - downloading.");
        WebClient webClient = new WebClient();
        webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
        webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
        webClient.DownloadFileAsync(new Uri("http://mysite.com/client/" + filename), path);
    }

    public void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
    {
        progressBar1.Value = e.ProgressPercentage;
    }

    private void Completed(object sender, AsyncCompletedEventArgs e)
    {
        MessageBox.Show("Finished.");
    }

Can someone point me out what’s wrong? I’ve thought maybe it needed to be ran as Administrator, but that just did the same exact thing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:30:48+00:00Added an answer on June 10, 2026 at 4:30 am

    Your code tries to save to folder path (“…\lob\”) which is not file name like (…\lob\my_file.ext”).

    WebClient.DownloadFileAsync(Uri Uri address, string fileName)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Code below, not sure what i'm doing wrong. It is an employee database. The
Code below produces button and icon: Button and input box are not in same
Code below redirects stdout to a file fname & then redirects back to original
My code below is a simple Titanium mobile application for Android. I implemented database
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
Code below is not working as expected to detect if it is in design
code below working fine but not in IE6, IE7, below is the code is
The code below gives me this mysterious error, and i cannot fathom it. I
Code below is part of cart66 WordPress plugin's php file. When I list options
Code below works great with aspx view engine, i am trying to convert it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.