I have some short code:
private void buttonSave_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "NHC|*.nhc";
openFileDialog1.Title = @"test.nhc";
OpenFileDialog openfiledialog = new OpenFileDialog();
openfiledialog.ShowHelp = true;
openfiledialog.FileName = "test.nhc";
openfiledialog.ShowDialog();
}
I want to set the FileName in OpenFileDialog
.
For example: I have a web app and I click Upload to upload a file from the local PC. The OpenFileDialog
PopUp does open. Now I want to set the FileName to test.nhc
in the field FileName
(Windows window) and click "Open".
But it doesn't work.