<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>ADM Blog &#187; clipboard</title> <atom:link href="http://blog.another-d-mention.ro/tag/clipboard/feed/" rel="self" type="application/rss+xml" /><link>http://blog.another-d-mention.ro</link> <description>No matter how you see things, reality changes when you reach understanding</description> <lastBuildDate>Fri, 22 Jul 2011 06:56:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1</generator> <item><title>Use clipboard (copy/paste) in C# console application</title><link>http://blog.another-d-mention.ro/programming/c/use-clipboard-copypaste-in-c-console-application/</link> <comments>http://blog.another-d-mention.ro/programming/c/use-clipboard-copypaste-in-c-console-application/#comments</comments> <pubDate>Mon, 01 Mar 2010 20:04:23 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[C#]]></category> <category><![CDATA[.net]]></category> <category><![CDATA[clipboard]]></category> <category><![CDATA[copy]]></category> <category><![CDATA[paste]]></category> <guid
isPermaLink="false">http://blog.another-d-mention.ro/?p=805</guid> <description><![CDATA[This took me few minutes to figure out and was quite annoying. First you must add a reference to System.Windows.Forms in your application. Go to Project -&#62; Add reference, select System.Windows.Forms from .NET tab in the window that just opened.  You must avoid the ThreadStateException by applying the STAThread attribute to your Main() function. Then [...]
Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/communicate-betwen-c-and-an-embeded-flash-application/' rel='bookmark' title='Permanent Link: Communicate betwen C# and an embeded Flash application'>Communicate betwen C# and an embeded Flash application</a></li><li><a
href='http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/' rel='bookmark' title='Permanent Link: How to clone (duplicate) an object in ActionScript 3'>How to clone (duplicate) an object in ActionScript 3</a></li><li><a
href='http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/' rel='bookmark' title='Permanent Link: How to identify at runtime if the swf is in debug or release mode/build'>How to identify at runtime if the swf is in debug or release mode/build</a></li></ol>]]></description> <content:encoded><![CDATA[<p><img
src="http://cache.another-d-mention.ro/images/wp-content/uploads/2010/03/net_logo.jpg-150x150.png" alt="net logo.jpg 150x150 Use clipboard (copy/paste) in C# console application" title="net_logo.jpg" width="150" height="150" class="alignleft size-thumbnail wp-image-806" />This took me few minutes to figure out and was quite annoying. First you must add a reference to System.Windows.Forms in your application. Go to Project -&gt; Add reference, select <strong>System.Windows.Forms</strong> from .NET tab in the window that just opened.  You must avoid the ThreadStateException by applying the STAThread attribute to your Main()  function. Then you can use the Clipboard functions without any problems.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Windows.Forms</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #6666cc; font-weight: bold;">class</span> Program <span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>STAThread<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
         Clipboard<span style="color: #008000;">.</span><span style="color: #0000FF;">SetText</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;this is in clipboard now&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/communicate-betwen-c-and-an-embeded-flash-application/' rel='bookmark' title='Permanent Link: Communicate betwen C# and an embeded Flash application'>Communicate betwen C# and an embeded Flash application</a></li><li><a
href='http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/' rel='bookmark' title='Permanent Link: How to clone (duplicate) an object in ActionScript 3'>How to clone (duplicate) an object in ActionScript 3</a></li><li><a
href='http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/' rel='bookmark' title='Permanent Link: How to identify at runtime if the swf is in debug or release mode/build'>How to identify at runtime if the swf is in debug or release mode/build</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://blog.another-d-mention.ro/programming/c/use-clipboard-copypaste-in-c-console-application/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
