Hey I have two buttons , One Browse which when i click I browse the file i want.
the code is as follows:
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Title = "Browse File";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
txtFile.Text = openFileDialog1.FileName;
}
}
now on clicking the next button I want to pass the above file to this button so I can perform my operation
Code:
if (openFileDialog1.CheckFileExists)
{
string SelectedFile = openFileDialog1.FileName;
{
-----------
}}
but its throwing an error saying
Empty path name is not legal.:
Please help.
Urgent !!