C#文件写入

来源:互联网 发布:php for循环乘法口诀表 编辑:程序博客网 时间:2024/06/11 10:54
static bool WriteFile(string filepath,string args){FileInfo fileinfo = new FileInfo(filepath);  if (!fileinfo.Exists) {FileStream fs = File.Create(filepath);fs.Flush(); fs.Close(); StreamWriter sw = new StreamWriter(filepath, true);sw.WriteLine(args+"\n"); sw.Flush();sw.Close();} return true;}


0 0
原创粉丝点击