示例#1
0
 public static void IniciarLOG(string Text)
 {
     Console.WriteLine(_path);
     try
     {
         if (!File.Exists(_path))
         {
             using (StreamWriter write = new StreamWriter(_path, true, Encoding.UTF8))
             {
                 write.WriteLine(SistemLog.StringLog(Text));
                 write.Flush();
                 write.Close();
             }
         }
         else
         {
             File.Delete(_path);
             using (StreamWriter write = new StreamWriter(_path, true, Encoding.UTF8))
             {
                 write.WriteLine(SistemLog.StringLog(Text));
                 write.Flush();
                 write.Close();
             }
         }
     }
     catch (Exception e)
     {
     }
 }
示例#2
0
 public static void SalvarLog(string Text)
 {
     try
     {
         using (StreamWriter write = new StreamWriter(_path, true, Encoding.UTF8))
         {
             write.WriteLine(SistemLog.StringLog(Text));
             write.Flush();
             write.Close();
         }
     }
     catch (Exception e)
     {
     }
 }