关于转文本文件的问题 用 BCP 或 BULK INSERT 详细 请看Sql Server 联机丛书 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System.IO;StreamWriter wr = new StreamWriter(Server.MapPath("文件名"),false);wr.Write(时间值+内容);wr.Flush();wr.Close(); FileStream fsobj=new FileStream(Path,System.IO.FileMode.Create,FileAccess.ReadWrite); StreamWriter _sw=new StreamWriter(fsobj,System.Text.UnicodeEncoding.Unicode);_sw.Write(时间值+内容);_sw.close();fsobj.close(); this.dt.Clear(); this.dt = this.IA.ReturnChoose("SW_PMSALBON",""); if(this.textBox1.Text.Trim() =="") { MessageBox.Show("转账文件路径不能为空,请输入"); this.textBox1.Focus(); return; } try { if(File.Exists(this.textBox1.Text)) { DialogResult r = MessageBox.Show ( "文件已经存在,是否要重新生成!" , "生成转账文件!" , MessageBoxButtons.YesNo , MessageBoxIcon.Question ) ; if (DialogResult.Yes ==r) { File.Delete(this.textBox1.Text); } else { return; } } } catch(System.Exception ex) { MessageBox.Show("文件路径格式输入错误,请确认!"); return; } StreamWriter writer = null; try { writer = new StreamWriter(this.textBox1.Text,true); foreach(DataRow dr in dt.Tables[0].Rows) { writer.WriteLine(dr[0].ToString()+dr[1].ToString()); } MessageBox.Show("已经成功的生成了转账文件,请查看"); } catch(IOException E) { MessageBox.Show("读写文件错误"); e.ToString(); } finally { if (writer != null) writer.Close(); } //导出完毕,显示出来记事本if(File.Exists(this.textBox1.Text)){System.Diagnostics.Process.Start(this.textBox1.Text);} C#怎么把Bitmap格式的图片流转成video视频 oledbdatareader是独占连接吗? 5.急求需要能运行出来的完整程序!急啊! 有没有专门的c#源代码 网站 怎样使文本框的滚动条自动向下滚动 比较特殊的添加xml节点怎么处理呢? 请教一个有个RTC Client API方面的问题 asp:hyperlink与asp:Image的怪事,超链位置下移 关于字符串的执行效率的问题? ADO.net是否有以前ADO中的分页显示功能? 没装打印机可不可以实现RichEdit的打印预览功能?我用了MSDN上的代码 微软的msdn如何使用
StreamWriter wr = new StreamWriter(Server.MapPath("文件名"),false);
wr.Write(时间值+内容);
wr.Flush();
wr.Close();
StreamWriter _sw=new StreamWriter(fsobj,System.Text.UnicodeEncoding.Unicode);
_sw.Write(时间值+内容);
_sw.close();
fsobj.close();
this.dt = this.IA.ReturnChoose("SW_PMSALBON","");
if(this.textBox1.Text.Trim() =="")
{
MessageBox.Show("转账文件路径不能为空,请输入");
this.textBox1.Focus();
return;
}
try
{
if(File.Exists(this.textBox1.Text))
{
DialogResult r = MessageBox.Show ( "文件已经存在,是否要重新生成!" , "生成转账文件!" , MessageBoxButtons.YesNo , MessageBoxIcon.Question ) ;
if (DialogResult.Yes ==r)
{
File.Delete(this.textBox1.Text);
}
else
{
return;
}
}
}
catch(System.Exception ex)
{
MessageBox.Show("文件路径格式输入错误,请确认!");
return;
}
StreamWriter writer = null;
try
{
writer = new StreamWriter(this.textBox1.Text,true);
foreach(DataRow dr in dt.Tables[0].Rows)
{
writer.WriteLine(dr[0].ToString()+dr[1].ToString());
}
MessageBox.Show("已经成功的生成了转账文件,请查看"); }
catch(IOException E)
{
MessageBox.Show("读写文件错误");
e.ToString();
}
finally
{
if (writer != null)
writer.Close();
}
if(File.Exists(this.textBox1.Text))
{
System.Diagnostics.Process.Start(this.textBox1.Text);
}