【生意多】-免费发布分类信息
当前位置: 首页 » 新闻 » 观点 » 正文

超级月亮拍照模式(超级月亮2022年在什么时候出现)

放大字体  缩小字体 发布日期:2022-07-08 14:29:22    浏览次数:17

//文件操作

01 /// <summary>        /// 写日志文件        /// </summary>        /// <param name="sPath">    年月  例  2011-04</param>        /// <param name="sFileName">月日  例  04-22</param>        /// <param name="content">时间+  内容</param>        /// <returns></returns>        public static bool WriteLog(string sPath, string sFileName, string content)        {            try            {                                 StreamWriter sr;                if (!Directory.Exists(sPath))                {                    Directory.CreateDirectory(sPath);                }                string v_filename = sPath+""+ sFileName;                  if (!File.Exists(v_filename)) //如果文件存在,则创建File.AppendText对象                {                    sr = File.CreateText(v_filename);                    sr.Close();                }                using (FileStream fs = new FileStream(v_filename, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.Write))                {                    using (sr = new StreamWriter(fs))                    {                                                 sr.WriteLine(DateTime.Now.ToString("hh:mm:ss")+"     "+ content);                        sr.Close();                    }                    fs.Close();                }                return true;             }            catch { return false; }        }

 
(文/小编)
打赏
免责声明
• 
本文为小编原创作品,作者: 小编。欢迎转载,转载请注明原文出处:https://www.31duo.com/news/show-3706827.html 。本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们。
 

(c)2016-2019 31DUO.COM All Rights Reserved浙ICP备19001410号-4

浙ICP备19001410号-4