我有一些短代码:
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();
}
我想将 FileName 设置为OpenFileDialog
.
例如:我有一个 Web 应用程序,然后单击Upload以从本地 PC 上传文件。OpenFileDialog
弹出窗口确实打开了。现在我想test.nhc
在字段FileName
(Windows 窗口)中将 FileName 设置为,然后单击“打开”。
但它不起作用。