| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3361 人关注过本帖
标题:[求助]如何通过saveFileDialog把textbox中的内容写入文件
只看楼主 加入收藏
unpowertome
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-5-6
收藏
得分:0 
openFileDialog1.Filter="txt(*.txt)|*.txt|allfill(*.*)|*.*";
openFileDialog1.FilterIndex=1;
openFileDialog1.RestoreDirectory=true;
if(openFileDialog1.ShowDialog()==DialogResult.OK)
{
this.crystalReportViewer1.ReportSource=openFileDialog1.FileName;
}

2007-05-06 12:39
unpowertome
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-5-6
收藏
得分:0 
SaveFileDialog sd=new SaveFileDialog();
sd.Filter="txt(*.txt)|*.txt|allfill(*.*)|*.*";
sd.RestoreDirectory=true;
if(sd.ShowDialog()==DialogResult.OK)
{
string flname=sd.FileName;
StreamWriter sw=new StreamWriter(flname);
sw.Write(this.textBox1.Text);
sw.Flush();
sw.Close();
}

2007-05-06 12:40
快速回复:[求助]如何通过saveFileDialog把textbox中的内容写入文件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016096 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved