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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:36:36+00:00 2026-06-13T22:36:36+00:00

I have 2 buttons (Button1 – Browse ; Button2 – Upload) and 1 textBox

  • 0

I have 2 buttons (Button1 – Browse ; Button2 – Upload) and 1 textBox

Here is the scenario. When I click on Browse, it will open a window and will browse for a specific item.
The selected item will display on textbox.

private void Browse_Click(object sender, EventArgs e)
{
    btnSample.Title = "Sample File Upload";
    btnSample.InitialDirectory = @"c:\";
    btnSample.Filter = "TIF|*.tif|JPG|*.jpg|GIF|*.gif|PNG|*.png|BMP|*.bmp|PDF|*.pdf|XLS|*.xls|DOC|*.doc|XLSX|*.xlsx|DOCX|*.docx";
    btnSample.FilterIndex = 2;
    btnSample.RestoreDirectory = true;
    if (btnSample.ShowDialog() == DialogResult.OK)
    {
        textBox1.Text = btnSample.FileName;
    }
}

When I click on the Upload Button the file on the textbox will be on the created folder.
I’m done with creating the folder. but my problem is how can i insert the selected file on the folder.

private void button4_Click(object sender, EventArgs e)
{
    string path = @"C:\SampleFolder\NewFolder";
    if (!Directory.Exists(path))
    {
        Directory.CreateDirectory(path);
        MessageBox.Show("Successfully Created New Directory");
    }
    else
    {
        MessageBox.Show("Filename Exist");
    }
}
  • 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-13T22:36:37+00:00Added an answer on June 13, 2026 at 10:36 pm
    var sourceFilePath = @"C:\temp\file.txt";
    var destFilePath= @"C:\otherFolder\file.txt";
    

    If you want to move the file:

    File.Move(sourceFilePath, destFilePath);
    

    If you want to copy the file

    File.Copy(sourceFilePath, destFilePath);
    

    easy huh?
    ofcourse, you’d have to adapt the paths to your problem…

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

Sidebar

Related Questions

I have the 3 buttons id's like #button1,#button2,#button3 .Now I click #button2 ,here i
In my case, I have a TextBox and two buttons Button1 and Button2. Here
I have two buttons, which the user can click and will open a FileDiagloag
I have a bunch of buttons named: button1 button2 button3 etc. Is there a
i have two buttons. now i want the vistor to click the button2, the
I have three buttons (button1, button2, button3), displaying respectively 1, 2 and 3 on
I have buttons with id's button1, button2, button3, etc. I have a for loop
I have a main form (frmMain) , with some buttons (button1, button2...) . then
I have three buttons Button1 btn1 = (Button) findViewById(R.id.button1); Button2 btn2 = (Button) findViewById(R.id.button2);
i have three buttons in my view page says Button1 , Button2 & Button3

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.