473,804 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clipboard in console app?

Hi,

I have a little console app that just does a little bit of processing. The
last thing I want it to do before it exists is stick a string onto the
clipboard. I will then access the clipboard and get the info I need. For
instance, run the console app, and then past the info into a notepad after
it runs. The only problem is that I can't seem to access the clipboard from
a console app.

Is this even possible?

Thanks
Nov 20 '05 #1
2 5644
* "Scott Kilbourn" <sk*******@nosp amplease.applie dsystems.com> scripsit:
I have a little console app that just does a little bit of processing. The
last thing I want it to do before it exists is stick a string onto the
clipboard. I will then access the clipboard and get the info I need. For
instance, run the console app, and then past the info into a notepad after
it runs. The only problem is that I can't seem to access the clipboard from
a console app.


Add a reference to "System.Windows .Forms.dll", then import the
'System.Windows .Forms' namespace and use the 'Clipboard' class.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Excellent! Thank you very much! :)

This is my first console app. I'm used to all that stuff being there for
the windows forms.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:c4******** *****@ID-208219.news.uni-berlin.de...
* "Scott Kilbourn" <sk*******@nosp amplease.applie dsystems.com> scripsit:
I have a little console app that just does a little bit of processing. The last thing I want it to do before it exists is stick a string onto the
clipboard. I will then access the clipboard and get the info I need. For instance, run the console app, and then past the info into a notepad after it runs. The only problem is that I can't seem to access the clipboard from a console app.


Add a reference to "System.Windows .Forms.dll", then import the
'System.Windows .Forms' namespace and use the 'Clipboard' class.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1723
by: keith | last post by:
I can use following codes to set and get object (serializable class) from Clipboar Clipboard.SetDataObject(obj) then DataObject data=new DataObject() obj=(ClassType)data.GetData(typeof(ClassType))
0
2006
by: Christopher | last post by:
Hello, First, I appologize for the length but I want to get all the facts down so as not to waste any time :) I'm trying to allow the user of my C# app to copy a DataGrid full of double values to the clipboard (via ctrl-C, edit->copy, etc). They can then paste these values wherever (but in particular, excel). I've searched the web fairly exhaustively and cannot find an answer to this. Every time someone asks, somone answers with the...
3
1472
by: Bill Belliveau | last post by:
Hello all I have the need to copy something to the clipboard via 3rd party type library and then pick it up on the .NET side via the clipboard (all server-side). To complicate the issue, the application needs to be web oriented (ASP.NET) I have a console version that work, but I can’t seem to get the ASP side working. I have included the Forms assembly and I'm able to write to the clipboard via the 3rd party, but the clipboard is...
2
2933
by: Jarod_24 | last post by:
I'm working on a console-view for my application wich is kinda a replacement for the orignal cmd.exe in windows xp. I could simply use .Write() to do that, but how do i paste the text so that the user can edit it (just like you can do in command.com and cmd.exe)
9
5960
by: Tim Frawley | last post by:
I have converted a VB6 application to VB.NET. The old application made extensive use of the Clipboard for copying an Image Name so that it could be pasted into the image capture app when the user scans the image. My applications run as compiled assemblies from our Intranet server and I have setup a Main sub routine in the application with the following line: <STAThread()> Public Sub Main() Note: There is no timer in this application.
2
457
by: Scott Kilbourn | last post by:
Hi, I have a little console app that just does a little bit of processing. The last thing I want it to do before it exists is stick a string onto the clipboard. I will then access the clipboard and get the info I need. For instance, run the console app, and then past the info into a notepad after it runs. The only problem is that I can't seem to access the clipboard from a console app. Is this even possible?
9
21482
by: The.Relinator | last post by:
I need to retrieve a string from the clipboard in a console application, I have tried many methods but all seem to return a null value, any help regarding this issue would be greatly appreciated
15
12305
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the Clipboard class to get an EnhancedMetafile or MetafilePict object from the Clipboard, use that to create a new Metafile object, and then draw that Metafile object using Graphics.DrawImage. It doesn't seem to be that simple.
3
7308
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm using the following in my console app: My.Computer.Clipboard.SetText(sb.ToString()) i'm getting inconsistent results with the copy. sometimes it works and most of the time i get the following error below. i just keep executing until it works. i'm getting the following error:
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.