-
Notifications
You must be signed in to change notification settings - Fork 0
/
Start.cs
62 lines (58 loc) · 1.36 KB
/
Start.cs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Windows.Forms;
namespace DBTableMover
{
/// <summary>
/// checks commandline options, checks the user's licence file, and starts the main form
/// </summary>
public class Start
{
private static ProjectInfo inf = new ProjectInfo();
public Start()
{
//
// TODO: Add constructor logic here
//
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
foreach(string arg in args)
{
if (arg.ToUpper() == "/DEBUG")
ProjectVariables.debugMode = true;
}
Licence lic = new Licence();
if(lic.Valid)
{
try
{
Application.Run(new frmMain());
}
catch(Exception x)
{
WriteLog("Error Running Main Form : Is your SQL Server running ????");
WriteLog(x.Message.ToString());
}
}
else
{
MessageBox.Show("Bad Licence, contact [email protected] for a licence file.", inf.error, MessageBoxButtons.OK, MessageBoxIcon.Stop);
inf.error = "NEW Error titles....";
WriteLog("Bad License Attempt");
Application.Exit();
}
}
/// <summary>
/// used to write to the log
/// </summary>
/// <param name="message">message to send to the log</param>
private static void WriteLog(string message)
{
ProjectMethods.WriteLog("Start", message);
}
}
}