FileStream fs = new FileStream ( "C:\\file.txt"  , FileMode.Open , FileAccess.Read ) ;
    StreamReader m_streamReader = new StreamReader ( fs ) ; 
  //使用StreamReader类来读取文件
  m_streamReader.BaseStream.Seek ( 0 , SeekOrigin.Begin ) ;
    // 从数据流中读取每一行,直到文件的最后一行,并在richTextBox1中显示出内容
    this.richTextBox1.Text = "" ;
    string strLine = m_streamReader.ReadLine ( ) ;
    while ( strLine != null )
    {
      this.richTextBox1.Text += strLine + "\n" ;
      strLine = m_streamReader.ReadLine ( ) ;
    }
    //关闭此StreamReader对象
    m_streamReader.Close ( ) ;

解决方案 »

  1.   

    上面的代码是把读取的文本文件,用一个richTextBox组件显示出来。
      

  2.   

    我是想直接用记事本打开TXT文件
      

  3.   

    打开exe程序可以直接调用api
    WinExec(LPCSTR lpCmdLine,UINT uCmdShow)
    打开RM文件你自己可以去查一下!
      

  4.   

    System.Diagnostics.Process.Start("help.txt");
      

  5.   

    System.Diagnostics.Process.Start("notepad.exe","help.txt"); //用记事本
    System.Diagnostics.Process.Start("wordpad.exe","help.txt"); //用写字板