Created
February 13, 2010 00:46
-
-
Save kriskowal/303158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Pastebin | |
{ | |
class Pbcopy | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
try | |
{ | |
System.Windows.Forms.Clipboard.SetDataObject( | |
System.Console.In.ReadToEnd(), | |
true | |
); | |
} | |
catch ( System.Exception ) | |
{ | |
System.Console.Out.WriteLine("Unable to post to clipboard"); | |
throw; | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Pastebin | |
{ | |
using System; | |
using System.Windows.Forms; | |
class Pbpaste | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
try | |
{ | |
Console.Out.Write( Clipboard.GetDataObject().GetData( | |
System.Windows.Forms.DataFormats.StringFormat | |
) ); | |
} | |
catch ( Exception ) | |
{ | |
Console.Out.WriteLine( "Unable to post clipboard contents" ); | |
throw; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment