Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 59 → Rev 60

/SWAT Office App/tags/Release_2.6.2/SWAT Office App/DebugText.cs
0,0 → 1,41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
 
namespace SWAT_Office_App
{
class DebugText
{
private static string debugLocation = "StatusLog.txt";
public static void appendText(string text)
{
// Appends passed string into Debug.txt
using (StreamWriter sw = File.AppendText(debugLocation))
{
sw.Write("[" + DateTime.Now.ToLongDateString() + " | " + DateTime.Now.ToLongTimeString() + "] -- ");
sw.Write(text + "\r\n");
sw.Flush();
}
}
public static void createNewDebugTxt()
{
// Deletes old Debug.txt and creates a new one
if (File.Exists(debugLocation))
{
File.Delete(debugLocation);
File.Create(debugLocation);
}
}
public static void startNewSession()
{
using (StreamWriter sw = File.AppendText(debugLocation))
{
sw.Write("-- New Session --\r\n");
sw.Flush();
}
}
}
}