title: How to clear the clipboard contents using C#
body: <p>I have an application where I am using the clipboard for copy and paste operations. For copying I have used this code:</p>
  
  <pre><code>Clipboard.Clear();
  const byte VK_CONTROL = 0x11;
  keybd_event(VK_CONTROL, 0, 0, 0);
  keybd_event(0x43, 0, 0, 0); // Send the C key (43 is "C")
  keybd_event(0x43, 0, CONST_KEYEVENTF_KEYUP, 0);
  keybd_event(VK_CONTROL, 0, CONST_KEYEVENTF_KEYUP, 0);
  </code></pre>
  
  <p>But it's giving an error saying <strong>Unable to perform the clipboard action</strong>, and I am unable to paste it. It's throwing an exception.</p>
  
  <p>How do I fix this issue or are there some other ways to clear the clipboard content before we copy?</p>