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 7986477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:51:54+00:00 2026-06-04T11:51:54+00:00

For some reason, the user that installs this, when they click the button, nothing

  • 0

For some reason, the user that installs this, when they click the button, nothing happens. Also, if i take the try and catch, it says the file already exists, and it does not. The sub folder does, but not the file. What is wrong? Here is my code:

            string pathUser4 = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            string pathDownload4 = (pathUser4 + @"\Downloads\");
            string sourceFile = pathDownload4 + listBox1.Text;

            string pathdoc5 = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            string pathDownload5 = (pathdoc5 + @"\iracing\setups\");
            string destinationFile = pathDownload5 + comboBox1.Text;

            File.Move(sourceFile, destinationFile);
        }
        catch { }
            if (comboBox1.Text == "Select File Destination")
            {
                MessageBox.Show("Please Select A Destination Folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
  • 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-04T11:51:55+00:00Added an answer on June 4, 2026 at 11:51 am

    I think your first problem is your checking the comboBox1.Text for a proper value AFTER you’ve attempted to move the file.

    Second use the Path object as MichelZ suggested. It’s easier and should not cause any issue.

    Here is what your code would like with the changes:

            // TODO: check for listBox1.Text to be blank or non-file
    
            if (comboBox1.Text == "Select File Destination")
            {
                MessageBox.Show("Please Select A Destination Folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
    
            string sourceFile = Path.Combine(Environment.SpecialFolder.UserProfile, "Downloads", listBox1.Text;
            string destinationFile = Path.Combine(Environment.SpecialFolder.MyDocuments, "iracing", "setups", comboBox1.Text;
            File.Move(sourceFile, destinationFile);
        }
        catch { }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a wordpress plugin that redirects the user. for some reason, wp_redirect
Background: For some reason, whenever a user tries to open an xslx (excel 2007)
I have a controller user with a method login For some reason, when I
First time cake user and I'm having real apache problems. For some reason the
i have a large user Database (13k+), and for some reason i need to
The page in question is featured here: http://www.allwebcafe.com/news/news-article.php?id=78 For some reason, when a user
For some reason I'm really struggling with this. I'm new to wpf and I
For some reason, I was under the impression that it was just called Timeout,
From firsthand experience, it appears that ClickOnce only installs for the current user, and
Possible Duplicate: WPF MessageBox window style For some reason the MessageBox that comes with

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.