how to get file path in textbox using windows form application?
<p>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.</p>

<pre><code>private void brwsbtn_Click(object sender, EventArgs e)
        {
            if (openFD.ShowDialog() == DialogResult.OK)
            {
                  textBox1.Text = openFD.FileName;
            }
            textBox1.Text="";
        }
</code></pre>

<p>So that I am able to select files only. How can I select and place the folders path in textbox?.</p>

<p>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.</p>

<p>Note. Please let me know can we use to upload file without using Openfiledialog in windows form..</p>