小编Mac*_*inB的帖子

如何防止SaveFileDialog提示两次替换/覆盖文件?

如何阻止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)

.net c# savefiledialog winforms .net-4.7.2

5
推荐指数
1
解决办法
655
查看次数

阻止$ ArrayList.Add输出新索引到主机?

在PowerShell中,如何防止[System.Collections.ArrayList]$ArrayList=@() ; $ArrayList.Add("New thing")将新索引的值发送到主机?

谢谢!

arrays indexing powershell arraylist output

2
推荐指数
1
解决办法
313
查看次数