Click here to Skip to main content
15,915,336 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
How to execute the coding for browse option in C#. When I'm clicking browse button it should show the valid path of the file.

Regards
Balamurugan
Posted
Updated 27-Sep-12 18:05pm
v2

Hi Bala,

You can use file Upload Button in ASp.net

<asp:fileupload id="upload" runat="server" />


if you use then you can get browse files

Thanks
Mohan
 
Share this answer
 
v2
Hi bala

You can try this OpenFileDialog in C#


OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "C# Corner Open File Dialog" ;
fdlg.InitialDirectory = @"c:\" ;
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*" ;
fdlg.FilterIndex = 2 ;
fdlg.RestoreDirectory = true ;
if(fdlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fdlg.FileName ;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900