I want to create a program containing a browse button, where we can go to the selected folder and open the file inside the folder.
I need a link and reading, where can I solve my problems? How and what methods / class should I use. I do not prefer reading from MSDN to be difficult for me to understand their theory. FYI I'm still new to C #.
Many thanks
P / s: Here is the code I found on the Internet where you can browse / create a new folder. But I do not know why it uses Shell32.dll ..
private void button1_Click(object sender, EventArgs e)
{
string strPath;
string strCaption = "Select a Directory and folder.";
DialogResult dlgResult;
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, strCaption, 0,
System.Reflection.Missing.Value);
if (fld == null)
{
dlgResult = DialogResult.Cancel;
}
else
{
strPath = fld.Self.Path;
dlgResult = DialogResult.OK;
}
}
source
share