]> jfr.im git - z_archive/kelsier.git/blob - Program.cs
b174ed9a2db5ee28ff0b496a52ebd25bb4d3cc0c
[z_archive/kelsier.git] / Program.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using MySql.Data.MySqlClient;
6
7 namespace Kelsier {
8 class Root {
9 static protected Database _db = null;
10 static public Database db { get { return _db; } }
11
12 static protected Logger _log;
13 static public Logger log { get { return _log; } }
14
15
16 static void Main(string[] args) {
17 System.IO.StreamWriter fileout = new System.IO.StreamWriter("kelsier.log", false);
18 fileout.AutoFlush = true;
19 System.IO.TextWriter[] outputs = { Console.Out, fileout };
20 _log = new Logger(outputs, outputs, outputs);
21
22 _db = new Database(Properties.Settings.Default.dbstr);
23
24 db.Connect();
25
26 log.debug("1 + 3 = {0}", db.queryScalar("SELECT 1+3").ToString());
27
28 _log = null;
29 GC.Collect();
30 GC.WaitForPendingFinalizers();
31
32 #if DEBUG
33 Console.Write("Key to end...");
34 Console.ReadKey();
35 #endif
36 }
37 }
38
39
40 }