private void button1_Click(object sender, EventArgs e)         {              string[] tempArray = new string[textBox1.Lines.Length];              tempArray = textBox1.Lines;              string prompt = "第" + this.textBox2.Text + "行的内容为:";              string title = "读取文本框指定行的内容";              MessageBox.Show(prompt+tempArray[int.Parse(this.textBox2.Text)-1],title);         }我想按行读取文本框内容放入数组中,找不到Lines属性。

解决方案 »

  1.   

    追问:可不可以用 StreamReader 读取 TextBox 内容?
      

  2.   

    string[] lines = textbox1.Lines;网上找的
    假如你是想获取输入的内容长度  来作为数组的大小
    那就这样试试string[] tempArray = new string[textBox1.text.tostring().trim().Length];
      

  3.   

    我用2008,TextBox 没有 Lines 属性。
      

  4.   

    你这个到底是winform还是asp.net?
    TextBox只有Text,没有Lines
    如果是winform,只有RichTextBox才有Lines
      

  5.   

    10 winform  textbox也有lines属性啊
      

  6.   

    说漏了,asp.net里的TextBox没有Lines