-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
72 lines (64 loc) · 2.17 KB
/
Program.cs
File metadata and controls
72 lines (64 loc) · 2.17 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Windows.Forms;
using System.IO;
namespace espaceNetSAV
{
static class Program
{
//Not used yet
static string filename = "config.data";
public static espaceNetSAV.Admin.User _USER = new Admin.User();
//Getting the configs from the database
public static string _KEY = "ESPACENETSAV";
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//Initial configuration using the file.
//Form formObject = new Form();
/*if (CheckForInitialConfiguration())
{
//This means the file doesn't have any value there for display the configuration form for the user
//formObject = new Admin.Configuration();
}
else
{
//This means the application is already configured
//This will run when the application is already configured.
//_USER = new Admin.User();
//formObject = new SplashScreen();
}*/
//End of intial configuration
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SplashScreen());
}
public static bool CheckForInitialConfiguration()
{
try
{
if (File.Exists(filename))
{
using (BinaryReader br = new BinaryReader(new FileStream(filename, FileMode.Open)))
{
var result = br.ReadString();
while (result != null)
{
//This means that the file has values
return true;
}
}
}
//This means the file doesn't have any values
return false;
}
finally
{
Console.WriteLine("Was done!");
}
//return false;
}
}
}