-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (36 loc) · 1.24 KB
/
Program.cs
File metadata and controls
41 lines (36 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.IO;
using MySql.Data.MySqlClient;
using System.Windows.Forms;
namespace Booking3
{
static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
SQLClass.CONN = new MySqlConnection(SQLClass.CONNECTION_STRING);
SQLClass.CONN.Open();
}
catch (Exception ex)
{
if (!File.Exists(Path.GetTempPath() + "/booking.txt"))
File.Create(Path.GetTempPath() + "/booking.txt");
File.AppendAllText(Path.GetTempPath() + "/booking.txt",
"Ошибка" + Environment.NewLine +
DateTime.Now.ToString() + Environment.NewLine +
ex.Message + Environment.NewLine + Environment.NewLine);
MessageBox.Show("Ошибка");
}
Application.Run(new MainForm());
SQLClass.CONN.Close();
}
}
}