<legend id='c6mUX'><style id='c6mUX'><dir id='c6mUX'><q id='c6mUX'></q></dir></style></legend>
    <tfoot id='c6mUX'></tfoot>

    1. <small id='c6mUX'></small><noframes id='c6mUX'>

    2. <i id='c6mUX'><tr id='c6mUX'><dt id='c6mUX'><q id='c6mUX'><span id='c6mUX'><b id='c6mUX'><form id='c6mUX'><ins id='c6mUX'></ins><ul id='c6mUX'></ul><sub id='c6mUX'></sub></form><legend id='c6mUX'></legend><bdo id='c6mUX'><pre id='c6mUX'><center id='c6mUX'></center></pre></bdo></b><th id='c6mUX'></th></span></q></dt></tr></i><div id='c6mUX'><tfoot id='c6mUX'></tfoot><dl id='c6mUX'><fieldset id='c6mUX'></fieldset></dl></div>

      • <bdo id='c6mUX'></bdo><ul id='c6mUX'></ul>
    3. 在 C# 中手动复制文件时显示复制文件对话框/表单?

      时间:2023-09-14

          <bdo id='n8JbU'></bdo><ul id='n8JbU'></ul>

          • <tfoot id='n8JbU'></tfoot>

              <i id='n8JbU'><tr id='n8JbU'><dt id='n8JbU'><q id='n8JbU'><span id='n8JbU'><b id='n8JbU'><form id='n8JbU'><ins id='n8JbU'></ins><ul id='n8JbU'></ul><sub id='n8JbU'></sub></form><legend id='n8JbU'></legend><bdo id='n8JbU'><pre id='n8JbU'><center id='n8JbU'></center></pre></bdo></b><th id='n8JbU'></th></span></q></dt></tr></i><div id='n8JbU'><tfoot id='n8JbU'></tfoot><dl id='n8JbU'><fieldset id='n8JbU'></fieldset></dl></div>

                <tbody id='n8JbU'></tbody>
              • <legend id='n8JbU'><style id='n8JbU'><dir id='n8JbU'><q id='n8JbU'></q></dir></style></legend>

              • <small id='n8JbU'></small><noframes id='n8JbU'>

                本文介绍了在 C# 中手动复制文件时显示复制文件对话框/表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在通过 C# 手动复制一些文件夹和文件,并且我想向用户展示实际正在发生的事情.目前,该程序看起来好像它被冻结了,但它实际上是在复制文件.

                I am manually copying some folders and files through C#, and I want to show the user that something is actually going on. Currently, the program looks as if its frozen, but it is actually copying files.

                我认为已经有一个显示该过程的内置对话框或表单,类似于在 Windows 资源管理器中复制/移动文件.有没有类似的东西,还是我必须从头开始创建所有东西?

                I would think there is already a built-in dialog or form that shows the process, similar to copying/moving files in windows explorer. Is there anything like that available, or will I have to create everything from scratch?

                另外,这是否是向用户显示某事正在积极进行的最佳方法?

                Also, would this be the best method to show the user that something is actively going on?

                感谢您的帮助!

                推荐答案

                Microsoft.VisualBasic.FileIO 命名空间内置了一个.不要让这个名字吓到你,它是一个非常被低估的 C# 命名空间.静态类 FileSystem 有一个 CopyFileCopyDirectory 方法具有该功能.

                There is one built in from the Microsoft.VisualBasic.FileIO Namespace. Don't let the name scare you, it is a very underrated namespace for C#. The static class FileSystem has a CopyFile and CopyDirectory method that has that capability.

                文件系统成员

                密切注意 CopyFileCopyDirectory 方法中的 UIOption.此模拟显示 Windows 资源管理器复制窗口.

                Pay Close attention to the UIOption in both the CopyFile and CopyDirectory methods. This emulates displays the Windows Explorer copy window.

                FileSystem.CopyFile(sourceFile, destinationFile, UIOption.AllDialogs);
                FileSystem.CopyDirectory(sourceDirectory, destinationDirectory, UIOption.AllDialogs);
                

                这篇关于在 C# 中手动复制文件时显示复制文件对话框/表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:创建返回值的自定义对话框的最简单方法是什么? 下一篇:自定义 IInternetSecurityManager 未通过对话框调用

                相关文章

                <i id='ekAtB'><tr id='ekAtB'><dt id='ekAtB'><q id='ekAtB'><span id='ekAtB'><b id='ekAtB'><form id='ekAtB'><ins id='ekAtB'></ins><ul id='ekAtB'></ul><sub id='ekAtB'></sub></form><legend id='ekAtB'></legend><bdo id='ekAtB'><pre id='ekAtB'><center id='ekAtB'></center></pre></bdo></b><th id='ekAtB'></th></span></q></dt></tr></i><div id='ekAtB'><tfoot id='ekAtB'></tfoot><dl id='ekAtB'><fieldset id='ekAtB'></fieldset></dl></div>

                    <small id='ekAtB'></small><noframes id='ekAtB'>

                    <legend id='ekAtB'><style id='ekAtB'><dir id='ekAtB'><q id='ekAtB'></q></dir></style></legend>

                      <bdo id='ekAtB'></bdo><ul id='ekAtB'></ul>
                    <tfoot id='ekAtB'></tfoot>