如何得到RichTextBox中的内容,纯TXT的内容,不包含任何格式!!!
谢谢!!1

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=0A6660CE-4138-41EF-B882-15DB65564709ContentHtml.Text = Regex.Replace(ContentHtml.Text,"<[^>]*>", "");
      

  2.   

    String text = richTextBox1.Text;Text 属性不返回任何有关应用于 RichTextBox 内容的格式的信息。要获取 RTF 代码,请使用 Rtf 属性。ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystemwindowsformsrichtextboxclasstexttopic.htm
      

  3.   

    比如我在RichTextBox中输入
    if RsClass.eof then
      document.write "<option>There is no dic in datebase</option>"
     else
      do while not RsClass.eof
      document.write "<option value=" & RsClass(0) & ">" & RsClass(1) & "</option>"
      RsClass.MoveNext
      loop
     end if
    其Text变为if RsClass.eof then
      document.write "<option>There is no dic in datebase</option>"
     else
      do while not RsClass.eof
      document.write "<option value=" & RsClass(0) & ">" & RsClass(1) & "</option>"
      RsClass.MoveNext
      loop
     end if
      

  4.   

    搞错了,其Text变为
    "\nif RsClass.eof then\n \tdocument.write \"<option>There is no dic in datebase</option>\"\n else\n \tdo while not RsClass.eof\n \t\tdocument.write \"<option value=\" & RsClass(0) & \">\" & RsClass(1) & \"</option>\"\n \t\tRsClass.MoveNext\n \tloop\n end if"