【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();
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();
相关文章推荐
- C# Winform中如何获取文件名与文件路径
- winform 获取文件相对路径一个方法
- ios学习 Mac下获取AppStore安装包文件路径
- python学习之获取文件动态路径命令
- C# winform中选择本地文件,并获取其路径
- C#.net Winform获取文件路径
- Linux学习之路--获取某目录下的所有文件的名字(包括路径)
- C#.net Winform获取文件路径
- 学习记录-Qt获取文件路径
- C#.net Winform获取文件路径
- 关于WinForm中获取文件路径的几个属性
- C# Winform中如何获取文件路径
- 获取文件路径 分类: WinForm 2014-07-25 14:27 103人阅读 评论(0) 收藏
- Java学习-009-文件名称及路径获取实例及源代码
- winform (c#) 获取文件路径
- C#.net Winform获取文件路径
- node.js认识学习二:__dirname获取当前模块文件所在目录的完整绝对路径
- C# Winform中如何获取文件路径
- Winform获取文件路径
- C#中Winform获取文件路径的方法实例小结