How to implement open filedialogbox in c#

C# Code:

String ImagePath=””;
OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
OpenFileDialog1.InitialDirectory = Convert.ToString(Environment.SpecialFolder.MyDocuments);
OpenFileDialog1.Filter = "(*.png)|*.png|All Files (*.*)|*.*";
OpenFileDialog1.FilterIndex = 1;

if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
{
    ImagePath= OpenFileDialog1.FileName;

}

Popular posts from this blog

How to play youtube without buffering in 2g