C#追加文件操作解析
C#追加文件中是我们在实际文件操作经常会遇到的问题,那么C#追加文件是如何实现的呢?下面我们通过实例演示来看看C#追加文件的具体实现过程。
C#追加文件实例:
- using SYSTEM.IO;
- //C#追加文件
- StreamWriter sw=File.AppendText(Server.MapPath(".")+"\\myText.txt");
- sw.WriteLine("追逐理想");
- sw.WriteLine("kzlll");
- sw.WriteLine(".NET笔记");
- sw.Flush();
- sw.Close();
- StreamWriter sw=File.AppendText(
- System.Windows.Forms.Application.
- StartupPath+"\\lgcx.log");
- sw.WriteLine(SysLog.FProgramName+
- SysLog.FCreateName+SysLog.FTime+SysLog.FId+
- SysLog.FPath+SysLog.FDesc);
- //sw.WriteLine("kzlll1");
- //sw.WriteLine(".NET笔记1");
- sw.Flush();
- sw.Close();
C#追加文件的实现内容就向你介绍到这里,希望对你了解和学习C#追加文件的操作有所帮助。
【编辑推荐】
- C#接口事件代理学习总结浅析
- C#写文件操作实例浅析
- C#写文件处理操作三大方法浅析
- C# FileStream写文件解析
- C# StreamReader文件处理操作解析
版权声明:
作者:后浪云
链接:https://www.idc.net/help/406449/
文章版权归作者所有,未经允许请勿转载。
THE END