Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
796 views
in Technique[技术] by (71.8m points)

command line - Can I get copy/paste functionality from a C# Console Window?

I am developing a console application in C#, and was wondering if there was a way to get the "copy-paste" or "mark-paste" functionality into my application, similar or identical to that of the standard Windows command prompt. Is this a wild goose chase or a simple application variable?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've copied text from the Console window and pasted it into another source many times.

It's there as default in a Console application;

Right click the console border:

Step 1

Select Edit > Mark:

Step 2

Drag over the text you want using the mouse (Or use the arrow keys) to select the text you want:

Step 3

Again, right click on the console border and select Edit > Copy:

Step 4

From here you can paste it into another application as you would with any other text.

This was taken from a C# Console application and the only code entered was the command to write to the console, no settings were changed.

Hope this helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...