在C#中,OpenFileDialog和SaveFileDialog的filter属性,如果想并列有多个格式,可以多个格式用 ; 隔开
如:
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "RTF文件|*.rtf;*.doc|所有文件|*.*";
ofd.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (ofd.ShowDialog() == DialogResult.OK && ofd.FileNames.Length>0)
{
string fi = ofd.FileName;
richTextBox1.LoadFile(fi,RichTextBoxStreamType.RichNoOleObjs);
}