我为保存文件创建了一个保存文件的脚本。它的初始位置设置为桌面。现在我的问题是,如何为对话框中的文件设置一个初始"名称"?
这是我的代码:
private SaveFileDialog save = new SaveFileDialog();
private void Information(string Basic, string nameoffile, string program)
{
if (doingsomething) return;
System.Windows.Forms.MessageBox.Show($"Please select where you would like to store the file)"
save.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
if (save.ShowDialog() == DialogResult.OK)
如果有答案,请指出我可以找到它的地方。因为我不知道确切的关键字。
您可以像 save.FileName="File1";