title: Read text file into Clipboard
body: <p>after along time of searching via google, I decided to poste my problem here.<br/>
  First: I am total C# Noob. <br/> I am using a Macro Recorder from Jitbit and I have no choice to use a different. The Problem is in the Macro Recorder, it is missing some essential things.<br/>
  Like reading a text file into a variable and paste this variable via Clipboard :-(
  However the good thing is, the tool support "some" type of native C# Code</p>
  
  <p>If I open the C# Command I get this:</p>
  
  <pre><code>public class Program
  {
      public static void Main()
      {
          System.Windows.Forms.MessageBox.Show("test");
      }
  }
  </code></pre>
  
  <p>And the C# program has to follow also these rules:
  => This Code MUST contain a class named "Program" with a static method "Main"<br/>
  I already used google and found code that should do the job but I get errors, I guess the
  code doesn`t follow the above rules.<br/>
  This is what I found and tried:</p>
  
  <pre><code>using System;
  using System.IO;
  public class Program
  {
      public static void Main()
      {
      // Read the file as one string.
      System.IO.StreamReader myFile =
       new System.IO.StreamReader("Counter.txt");
      string counter = myFile.ReadToEnd();
  
      myFile.Close();
  
      // Load string into clipboard
      Clipboard.SetDataObject( counter, true );
      }
  }
  </code></pre>
  
  <p>I always get the error : "Line 15: The Name Clipboard is not existing in the context"?!?
  I hope that someone can explain a noob (me) what is wrong and what is the correct code.
  Thanks.</p>