Program.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Reflection;
  3. using System.Windows.Forms;
  4. namespace MOKA_Factory_Tools
  5. {
  6. static class Program
  7. {
  8. /// <summary>
  9. /// 应用程序的主入口点。
  10. /// </summary>
  11. [STAThread]
  12. static void Main()
  13. {
  14. // 程序集信息;
  15. Assembly asm = Assembly.GetExecutingAssembly();
  16. // 获取公司名称;
  17. AssemblyCompanyAttribute asmcpn = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(asm, typeof(AssemblyCompanyAttribute));
  18. // 获取版本信息;
  19. AssemblyCopyrightAttribute asmCP = (AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(asm, typeof(AssemblyCopyrightAttribute));
  20. // 获取描述;
  21. AssemblyDescriptionAttribute asmdis = (AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(asm, typeof(AssemblyDescriptionAttribute));
  22. SXLibrary.Log.WriteInfoLog(string.Format("Program hash value = {0}", asmCP.Copyright));
  23. #region 创建数据库目录;
  24. string reportFolder = AppDomain.CurrentDomain.BaseDirectory + "DB";
  25. if ( !System.IO.Directory.Exists(reportFolder) )
  26. {
  27. System.IO.Directory.CreateDirectory(reportFolder);
  28. }
  29. // 创建数据库;
  30. if (!System.IO.File.Exists(reportFolder + "\\ReportData.db"))
  31. {
  32. if (SQLiteHelper.NewDbFile(reportFolder + "\\ReportData.db"))
  33. {
  34. SQLiteHelper.NewTable(reportFolder + "\\ReportData.db", "ReportData", "(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,url text,content text)");
  35. }
  36. }
  37. #endregion
  38. Application.EnableVisualStyles();
  39. Application.SetCompatibleTextRenderingDefault(false);
  40. Application.Run(new login());
  41. }
  42. }
  43. }