^ C不适用于C#中的文件复制 [英] ^C not working for file copy in C#
本文介绍了^ C不适用于C#中的文件复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个小应用程序
我选择文件格式文件夹然后按我的热键它发送一个复制命令就像这样
I create a small application
I select files form folder then Press My Hotkey it sends a Copy Command Like this
SendKeys.SendWait("^C");
但我无法从剪贴板获取文件路径,但记事本文本工作文件
为什么以任何其他方式获取剪贴板的文件路径
我尝试过:
i尝试
but after i cant get file paths from Clipboard but notepad text working file
Why is that any other way to get file paths to clipboard
What I have tried:
i tried
SendKeys.SendWait("^C");
和
And
SendKeys.Send("^C");
但问题是一样的
but problem is the same
推荐答案
最好使用剪贴板类。阅读本使用.NET处理剪贴板 [ ^ ]
Your best off using the clipboard class. Have a read of this Clipboard handling with .NET[^]
It SendKeys可能没有激活快捷命令Ctrl-C。您可以通过发送一系列菜单命令来获得所需的结果。
在资源管理器中,相当于Ctrl-C的菜单是
It is possible that SendKeys is not activating the shortcut command Ctrl-C. You may get the desired result by sending a sequence of menu commands.
In Explorer the menu equivalent of Ctrl-C is
Alt-E Open the edit menu
C 'Click' the copy menu item
而不是Ctrl-C发送Alt-E后跟C,即SendWait(%EC)
Alan。
Instead of Ctrl-C send Alt-E followed by C, i.e. SendWait("%EC")
Alan.
这篇关于^ C不适用于C#中的文件复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文