标签:style blog http io ar color sp on 文件
private void button1_Click(object sender, EventArgs e) { openFileDialog1.Filter = "*.txt|*.txt";//设置文件 DialogResult dr = openFileDialog1.ShowDialog();//显示打开文件对话框 if (dr ==DialogResult.OK) { richTextBox1.Text = System.IO.File.ReadAllText(openFileDialog1.FileName, Encoding.Default); } }
运行结果如图所示:
如何找到文件的家-打开文件对话框openFileDialog
标签:style blog http io ar color sp on 文件
原文地址:http://www.cnblogs.com/leijiangtao/p/4163144.html