你好,
下面的代码是如何得到剪切板的文件路径。
if (Clipboard.ContainsFileDropList())
{
foreach (string source in Clipboard.GetFileDropList())
{
}
}
如果要监听剪切板事件的话,需要使用系统方法:
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
详细的内容,可以参考:
https://stackoverflow.com/questions/621577/clipboard-event-c-sharp
Best regards,
Zhanglong
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.