在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
(转自:http://www.csharpwin.com/csharpspace/6649r3960.shtml) C#文件操作:C#追加文件 StreamWriter sw = File.AppendText( Server.MapPath(".") + "\\myText.txt"); sw.WriteLine("追逐理想"); sw.WriteLine("kzlll"); sw.WriteLine(".NET笔记"); sw.Flush(); sw.Close(); C#文件操作:C#拷贝文件 string OrignFile, NewFile;
OrignFile = Server.MapPath(".") + "\\myText.txt"; NewFile = Server.MapPath(".") + "\\myTextCopy.txt"; File.Copy(OrignFile, NewFile, true);
C#文件操作:C#删除文件
string delFile = Server.MapPath(".") + "\\myTextCopy.txt";
File.Delete(delFile); C#文件操作:C#移动文件
string OrignFile, NewFile;
OrignFile = Server.MapPath(".") + "\\myText.txt"; NewFile = Server.MapPath(".") + "\\myTextCopy.txt"; File.Move(OrignFile, NewFile); C#文件操作:C#创建目录 // 创建目录c:\sixAge |
请发表评论