This repository has been archived on 2022-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
awesome-email-extractor/Program.cs

54 lines
1.3 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Microsoft.Data.Sqlite;
namespace AwesomeEmailExtractor
{
internal static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
preMain();
2022-05-22 01:19:10 +03:00
Logs.GetLogs();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
postMain();
}
static void preMain()
{
if (!Directory.Exists(Globals.getAppDirectory()))
{
Directory.CreateDirectory(Globals.getAppDirectory());
}
2022-05-22 01:19:10 +03:00
Globals.db = new SqliteConnection("Data Source=" + Globals.getAppDatabase());
Globals.db.Open();
Globals.CreateTables();
2022-05-22 01:19:10 +03:00
Globals.logsDb = new SqliteConnection("Data Source=" + Globals.getPathAppLogs());
Globals.logsDb.Open();
Globals.CreateLogsTable();
}
static void postMain()
{
Globals.db.Close();
}
}
}