博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
文件打开与读入
阅读量:7198 次
发布时间:2019-06-29

本文共 301 字,大约阅读时间需要 1 分钟。

openFileDialog1.Filter = "文本文件(*.txt)|*.txt";//设置过滤参数

            openFileDialog1.ShowDialog();//显示打开文件的对话框
            textBox1.Text = openFileDialog1.FileName;
            StreamReader sr = new StreamReader(textBox1.Text, Encoding.Default);
            textBox2.Text = sr.ReadLine();
            sr.Close();

转载于:https://www.cnblogs.com/zhang123/p/3177409.html

你可能感兴趣的文章