8 Replies - 296 Views - Last Post: 23 April 2012 - 03:10 PM Rate Topic: -----

#1 Mobuis1995  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 15-February 12

Copy and pasting from console?

Posted 23 April 2012 - 02:17 PM

After making console applications with microsoft visual studio 2010, I am unable to select the data written (using the
Console.Out.Write()
)... Is there any way to enable this?

This post has been edited by Mobuis1995: 23 April 2012 - 02:18 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Copy and pasting from console?

#2 BigR1983  Icon User is offline

  • D.I.C Head

Reputation: 56
  • View blog
  • Posts: 215
  • Joined: 12-April 10

Re: Copy and pasting from console?

Posted 23 April 2012 - 02:22 PM

you are trying to directly highlight and copy from the console window?
If you are, right click and select 'Mark'. Then you are able to highlight a block of text. Pressing enter will allow you to copy.
Was This Post Helpful? 1
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 6469
  • View blog
  • Posts: 23,515
  • Joined: 12-June 08

Re: Copy and pasting from console?

Posted 23 April 2012 - 02:23 PM

What? you were able to select text with the console.out.write command? Are you sure it wasn't read?
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Closing in on 5,000
  • member icon

Reputation: 4928
  • View blog
  • Posts: 10,465
  • Joined: 02-June 10

Re: Copy and pasting from console?

Posted 23 April 2012 - 02:27 PM

I have to wonder about this... Your application WROTE the data. Why would you then need to highlight and copy it? You already have the data in your objects: You wrote it. You can then programmatically paste it to the clipboard.

http://msdn.microsof....clipboard.aspx
Was This Post Helpful? 1
  • +
  • -

#5 Mobuis1995  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 15-February 12

Re: Copy and pasting from console?

Posted 23 April 2012 - 02:32 PM

View Postmodi123_1, on 23 April 2012 - 02:23 PM, said:

What? you were able to select text with the console.out.write command? Are you sure it wasn't read?

I did use read, as I don't know how to keep the console from disappearing otherwise... In c++, I used system("pause") I believe. Is there any equivalent in C#?

This post has been edited by Mobuis1995: 23 April 2012 - 02:36 PM

Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 6469
  • View blog
  • Posts: 23,515
  • Joined: 12-June 08

Re: Copy and pasting from console?

Posted 23 April 2012 - 02:39 PM

Well there's running it FROM a console.

then there's break points... or just telling the debugger to break also works.

System.Diagnostics.Debugger.Break();

Was This Post Helpful? 0
  • +
  • -

#7 Mobuis1995  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 15-February 12

Re: Copy and pasting from console?

Posted 23 April 2012 - 03:01 PM

View PosttlhIn`toq, on 23 April 2012 - 02:27 PM, said:

I have to wonder about this... Your application WROTE the data. Why would you then need to highlight and copy it? You already have the data in your objects: You wrote it. You can then programmatically paste it to the clipboard.

http://msdn.microsof....clipboard.aspx

I've only begun reading over the class, but the examples in the clipboard class seem to only use text boxes/buttons. Am I able to use the class without these?

View Postmodi123_1, on 23 April 2012 - 02:39 PM, said:

Well there's running it FROM a console.

then there's break points... or just telling the debugger to break also works.

System.Diagnostics.Debugger.Break();

The
System.Diagnostics.Debugger.Break();
isn't working for me. My main method, as of now, is only
 static void Main(string[] args)
        {
            long Sum = primer(50) + fib(50) + oddCount(1, 50, 1);

            Console.Out.WriteLine(Sum);
            System.Diagnostics.Debugger.Break();
        }
. I only have 3 lines, and I still can't get it to do what I desire.. this is particularly frustrating...
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is offline

  • Closing in on 5,000
  • member icon

Reputation: 4928
  • View blog
  • Posts: 10,465
  • Joined: 02-June 10

Re: Copy and pasting from console?

Posted 23 April 2012 - 03:05 PM

Quote

I've only begun reading over the class, but the examples in the clipboard class seem to only use text boxes/buttons. Am I able to use the class without these?


Yes. It doesn't matter where the data comes from. They are just getting the data from the textbox. You can use whatever variable you like.
Was This Post Helpful? 0
  • +
  • -

#9 Mobuis1995  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 15-February 12

Re: Copy and pasting from console?

Posted 23 April 2012 - 03:10 PM

View PosttlhIn`toq, on 23 April 2012 - 03:05 PM, said:

Quote

I've only begun reading over the class, but the examples in the clipboard class seem to only use text boxes/buttons. Am I able to use the class without these?


Yes. It doesn't matter where the data comes from. They are just getting the data from the textbox. You can use whatever variable you like.

Thanks a lot, I'll be sure to read the class over.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1