I have one browse button and one text box. In the browse_button click event, I would like to browse the files and place the path name into textbox. For this I've written code like this by using openfile dialog.
private void brwsbtn_Click(object sender, EventArgs e)
{
if (openFD.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFD.FileName;
}
textBox1.Text="";
}
So that I am able to select files only. How can I select and place the folders path in textbox?.
In my application the user should able to select either file or folder through a single browse button. Please suggest me how to write code for this.
Note. Please let me know can we use to upload file without using Openfiledialog in windows form..