Exemple #1
0
 /// <summary>
 /// 删除文件
 /// </summary>
 /// <param name="path">路径</param>
 public static void DeleteFile(string path)
 {
     if (SysFile2.Exists(path))
     {
         File.Delete(path);
     }
 }
Exemple #2
0
 /// <summary>
 /// 写Framework日志文件
 /// </summary>
 public static void WriteLog(string logStr)
 {
     try
     {
         string logpath = SysConfig.LogFile;
         if (SysFile2.Exists(logpath))
         {
             FileInfo fi = new FileInfo(logpath);
             long     mn = fi.Length;
             if (mn > SysConfig.LogFileLength)//大于则删除文件
             {
                 fi.Delete();
             }
         }
         StreamWriter sw = new StreamWriter(logpath, true, Encoding.Unicode);
         sw.WriteLine(DateTime.Now.ToString("yy/MM/dd HH:mm:ss") + "    " + logStr);
         sw.Close();
     }
     catch
     {
     }
 }