为什么我的对话框不能打开文件的?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
string filename = null;
public Form1()
{
InitializeComponent();
}
private void openToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{ filename = openFileDialog1.FileName;
openFileDialog1.OpenFile();
}
}
}
}
问什么这里的OpenFile()不能打开TXT文件的??