你那个文件也许真的是格式不对,用Word试试能否打开
解决方案 »
- internal VisualStyleRenderer rOpen = new VisualStyleRenderer(VisualStyle
- c# schema文件读取(xsd文件)
- 怎样把大小不一样的 图片生成大小一样但不变形的图片类似于windows下缩略图的效果在线等
- 再问Person p = new Person;
- C#小问题
- 字符串对齐
- c# textbox js 赋值
- 关于WINFORM中的水晶报表的交叉表
- DataContext.SubmitChanges方法提交更新没有执行
- 实例
- 请教一个有关ObjectList的简单问题 散分20
- 哪位高手有DataGrid(WinForm)的详细使用实例
private void button3_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.OpenFileDialog opFile =new OpenFileDialog(); if (opFile.ShowDialog() == DialogResult.OK)
{
string filePath= opFile.FileName;
//MessageBox.Show(filePath);
try
{
this.richTextBox1.LoadFile(filePath, RichTextBoxStreamType.PlainText);
}
catch(System.IO.FileNotFoundException)
{
MessageBox.Show("No file to load yet");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}