您的位置:首页 > 其它

【winform学习】:获取文件路径

2012-03-18 16:55 281 查看
OpenFileDialog of1 = new OpenFileDialog();
          
           if (of1.ShowDialog() == DialogResult.OK)
           {
               textBox1.Text = of1.FileName;
           }

FileStream fs1 = new FileStream(textBox1.Text, FileMode.Open, FileAccess.Read);
            StreamReader sw1 = new StreamReader(fs1);
            textBox2.Text = sw1.ReadToEnd();
            sw1.Close();
            fs1.Close();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: