使用Windows默认副本

编程入门 行业动态 更新时间:2024-10-27 00:30:59
本文介绍了使用Windows默认副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有什么方法可以通过按钮调用Windows的复制事件吗?例如,我将文件添加到列表框中并选择目标驱动器,然后按按钮时,它应该复制文件.就像我将其(文件)拖到Windows资源管理器中的可移动磁盘上或在发送至"菜单中选择驱动器一样.

Is there any way that i can call windows'' copy event from a button. like, i add files to a list box and select a destination drive, and when i press the button, it should copy the files. same as it would do if i dragged it(the files) onto the removable disk in windows explorer or selecting the drive in the send to menu.

推荐答案

通过Shell文件操作(SHFileOperation)完成.查看链接以获取更多信息和示例: C#可以Shell,第2部分 [ ^ ] 祝你好运! It can be done with a Shell file operation (SHFileOperation). Check out the link for more info and examples: C# does Shell, Part 2[^] Good luck!

使用<a href="msdn.microsoft/en-us/library/system.io(v=VS.80).aspx">System.IO namespace</a>[<a href="msdn.microsoft/en-us/library/system.io(v=VS.80).aspx" target="_blank" title="New Window">^</a>]中类<a href="msdn.microsoft/en-US/library/system.io.file(v=VS.80).aspx">File</a>[<a href="msdn.microsoft/en-US/library/system.io.file(v=VS.80).aspx" target="_blank" title="New Window">^</a>]的静态方法<a href="msdn.microsoft/en-us/library/c6cfw35a(v=VS.80).aspx">Copy(String, String)</a>[<a href="msdn.microsoft/en-us/library/c6cfw35a(v=VS.80).aspx" target="_blank" title="New Window">^</a>]或<a href="msdn.microsoft/en-us/library/9706cfs5(v=VS.80).aspx">Copy(String, String, bool)</a>[<a href="msdn.microsoft/en-us/library/9706cfs5(v=VS.80).aspx" target="_blank" title="New Window">^</a>]. 干杯!
—MRB
Use the static method <a href="msdn.microsoft/en-us/library/c6cfw35a(v=VS.80).aspx">Copy(String, String)</a>[<a href="msdn.microsoft/en-us/library/c6cfw35a(v=VS.80).aspx" target="_blank" title="New Window">^</a>] or <a href="msdn.microsoft/en-us/library/9706cfs5(v=VS.80).aspx">Copy(String, String, bool)</a>[<a href="msdn.microsoft/en-us/library/9706cfs5(v=VS.80).aspx" target="_blank" title="New Window">^</a>] of class <a href="msdn.microsoft/en-US/library/system.io.file(v=VS.80).aspx">File</a>[<a href="msdn.microsoft/en-US/library/system.io.file(v=VS.80).aspx" target="_blank" title="New Window">^</a>] from the <a href="msdn.microsoft/en-us/library/system.io(v=VS.80).aspx">System.IO namespace</a>[<a href="msdn.microsoft/en-us/library/system.io(v=VS.80).aspx" target="_blank" title="New Window">^</a>]. Cheers!
—MRB

更多推荐

使用Windows默认副本

本文发布于:2023-11-09 16:03:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572814.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:副本   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!