2020-08-31 02:13:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Collections.Generic;
|
2020-09-24 06:20:07 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2020-08-31 06:52:43 +00:00
|
|
|
|
using ITC81DB_0H.Forms;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2020-08-31 06:52:43 +00:00
|
|
|
|
namespace ITC81DB_0H
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
|
|
|
|
static class Program
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The main entry point for the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MTAThread]
|
|
|
|
|
static void Main()
|
|
|
|
|
{
|
2020-09-24 06:20:07 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
2020-08-31 02:13:02 +00:00
|
|
|
|
Application.Run(new FormMain());
|
2020-09-24 06:20:07 +00:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
bool fileCheck = false, directoryCheck = false;
|
|
|
|
|
string fullFilePath = "", message = "";
|
|
|
|
|
StreamWriter sw;
|
|
|
|
|
|
|
|
|
|
DateTime time = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
fullFilePath = string.Format("SD Card\\DataBackup\\{0:yyyyMMdd_HHmmss}.txt", time);
|
|
|
|
|
message = ex.ToString();
|
|
|
|
|
|
|
|
|
|
DirectoryInfo di = new DirectoryInfo("SD Card\\DataBackup\\");
|
|
|
|
|
directoryCheck = di.Exists;
|
|
|
|
|
// 폴더 체크
|
|
|
|
|
if (directoryCheck == false)
|
|
|
|
|
di.Create();
|
|
|
|
|
|
|
|
|
|
FileInfo fileInfo = new FileInfo(fullFilePath);
|
|
|
|
|
fileCheck = fileInfo.Exists;
|
|
|
|
|
|
|
|
|
|
sw = new StreamWriter(fullFilePath, true, Encoding.UTF8);
|
|
|
|
|
sw.WriteLine(time.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
sw.Write(message);
|
|
|
|
|
sw.WriteLine();
|
|
|
|
|
sw.Close();
|
|
|
|
|
|
|
|
|
|
MessageBox.Show(message);
|
|
|
|
|
}
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|