开发者

Copy to clipboard without System.Windows.Forms.Clipboard?

开发者 https://www.devze.com 2023-04-08 15:09 出处:网络
Well the question is that. Is there anyway to copy text and/or files to the Windows clipboard WITHOUT using Clipboard Class from .NET开发者_开发百科? Depends on if I am answering the question in the t

Well the question is that. Is there anyway to copy text and/or files to the Windows clipboard WITHOUT using Clipboard Class from .NET开发者_开发百科?


Depends on if I am answering the question in the title or in the text... you can access System.Windows.Clipboard without having access to System.Windows.Forms...

string textData = "I want to put this string on the clipboard.";

// After this call, the data (string) is placed on the clipboard and tagged
// with a data format of "Text".
System.Windows.Clipboard.SetData(DataFormats.Text, (Object)textData);
0

精彩评论

暂无评论...
验证码 换一张
取 消