我想把BascMessage.sPath+"\\Data目录下的1.rtf,2.rtf,,,8.rtf.文件的内容全部放到richTextBoxmi中。思路如下:我循环把1.rtf,...,8.rtf倒入到一个RichTextBox,然后用Copy傅知道剪贴板,然后再把剪贴板的内容粘贴到另一个RichTextBox中。这段代码问什么在windows 2003能把所有的文件都粘贴在richTextBoxmi中,在windows xp中不好使,中间加个MessageBox.Show()就好使。
         String[] file={"1","2","3","4","5","6","7","8"};
String path;
foreach(String s in file)
{
path=BascMessage.sPath+"\\Data\\"+s+".rtf";
  this.richTextBoxSource.LoadFile(path);
this.richTextBoxSource.SelectAll();
this.richTextBoxSource.Copy();
                                     if(s!="1")
{
this.richTextBoxmi.AppendText("\r\n");
}
         //MessageBox.Show("正在生成第"+s+"文件");
DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.Rtf);
this.richTextBoxmi.Paste(myFormat);
}
我这样做主要是为了把1,...8文件合并成一个文件,其字体,颜色等都不变。