使用RichTextBox控件的LoadFile方法打开文件时,提示"无效文件格式"
代码如下:
private void button1_Click(object sender, System.EventArgs e)
{
try
{
richTextBox1.LoadFile(textBox1.Text,RichTextBoxStreamType.RichText);
}
catch(Exception e1)
{
MessageBox.Show(e1.Message,"提示对话框");
}
richTextBox1.Focus();
}