John

John

  • NA
  • 17
  • 0

how do I read line by line from a multi-line textbox in C#

Jan 16 2008 11:23 PM

Hi ya'll. I'm pretty new to c# (only been learning for a week) and I decided to start by trying to duplicate a windows shell script in C#. Whether you know it or not, you have all helped me tremendously up to this point with many of the other parts of this program.  I'm unfortunately at a bit of a sticking point that I hope ya'll can help me with.

Scenario:

I have a textbox that I want people to be able to copy and paste a list of computer names into. each computer name being on a different line. From there I want them to be able to click a button to connect through mstsc.exe to the computers.  It's important that I'm able to do this with a textbox as I have yet to figure out how to allow cut and paste into a listbox (unless someone here knows how to do that too! )

I'm having problems reading the data on a line by line basis from the textbox and passing it to mstsc.exe.  The best I've been able to accomplish is reading the entire contents of the textbox into a single string with each line seperated by \r\n . 

Thanks in advance!


Answers (2)