CSharp examples for System.Windows.Forms:Clipboard
Set Text to Clipboard
using System.Windows.Forms; using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;//from w w w.ja va 2s .c o m public class Main{ public static bool SetText(string text) { try { Clipboard.SetText(text); return true; } catch (Exception ex) { const string msg = "Failed to copy data to the clipboard."; Logger.Current.Warn(msg, ex); return false; } } }