private void toolsbopen_Click(object sender, EventArgs e)
{//打开文件
this.openFileDialog1.ShowDialog();
string StrFileName = this.openFileDialog1.FileName;
if (StrFileName.Trim() == "")
return;
try
{
this.richTextBox1.LoadFile(StrFileName, RichTextBoxStreamType.PlainText);
}
catch (Exception Error)
{
MessageBox.Show("文件格式无效,可先新建一个文档,保存后在打开测试!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}