如何阻止System.Windows.Forms.SaveFileDialog提示两次替换所选文件,而只提示一次?
要么我错过了什么,我的安装有问题,或者默认行为只是愚蠢.
var saveFileDialog = new SaveFileDialog();
saveFileDialog.ShowDialog();
// User selects file and clicks "Save" within the dialog
Run Code Online (Sandbox Code Playgroud)
我没有做任何特别的事情,这是一个空的Windows Forms项目,针对的是.NET Framework 4.7.2.
编辑:添加完整的Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var saveFileDialog = new SaveFileDialog();
saveFileDialog.ShowDialog();
}
}
}
Run Code Online (Sandbox Code Playgroud) 在PowerShell中,如何防止[System.Collections.ArrayList]$ArrayList=@() ; $ArrayList.Add("New thing")将新索引的值发送到主机?
谢谢!
.net ×1
.net-4.7.2 ×1
arraylist ×1
arrays ×1
c# ×1
indexing ×1
output ×1
powershell ×1
winforms ×1