private void openFileDialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
try
{
//我想通过openFileDialog在rtfTex中显示打开的文件,参 数怎么弄?
this.rtfText.LoadFile();
}
catch(System.IO.FileNotFoundException)
{
MessageBox.Show("No file to load yet");
}
}
{
try
{
//我想通过openFileDialog在rtfTex中显示打开的文件,参 数怎么弄?
this.rtfText.LoadFile();
}
catch(System.IO.FileNotFoundException)
{
MessageBox.Show("No file to load yet");
}
}
解决方案 »
- 求一个最简单的Socket异步通信例子
- 求答 datagridview 使用问题
- 我用的是windows2003,如何只查找目录和子目录,而不查找文件
- 奇怪的问题?晕
- 如何隐藏RichTextBox的插入点“|”
- .net安装制作中桌面快捷方式的问题
- devexpresscn如何修改Bar的北京颜色
- 在.net网页中怎么调用中科院的分词系统
- 有没人用过DataGrid+RadioButton
- IIS上运行一段时间后提示:The 'OraOLEDB.Oracle' provider is not registered on the local mach
- 高分请教用户控件,在线等。。。。。。
- 父类对象访问子类方法的问题
{
try
{
this.rtfText.LoadFile(openFileDialog.FileName);//Use file name from open-dialog
}
catch(System.IO.FileNotFoundException)
{
MessageBox.Show("No file to load yet");
}
}
cOpenFileDialog.Filter = "wav files (*.wav)|*.wav|mp3 files (*.mp3)|*.mp3";
cOpenFileDialog.FilterIndex = 1;if (cOpenFileDialog.ShowDialog() == DialogResult.OK)
{
if (cOpenFileDialog.FileName == null || cOpenFileDialog.FileName == "")
{
MessageBox.Show("Please select a file.");
return;
}
if (File.Exists(cOpenFileDialog.FileName) == false)
{
MessageBox.Show("The picture file is not exist.");
return;
}
if (LoadVoiceFile(cOpenFileDialog.FileName) != SYS_RETURN.OK)
MessageBox.Show("Fail to open picture file.");
}