Browse Source

创建本地数据库

jianfeng1.wang 2 years ago
parent
commit
9705c49bd5
1 changed files with 16 additions and 0 deletions
  1. 16 0
      FactoryTool_CShare/Program.cs

+ 16 - 0
FactoryTool_CShare/Program.cs

@@ -23,6 +23,22 @@ namespace MOKA_Factory_Tools
 
             SXLibrary.Log.WriteInfoLog(string.Format("Program hash value = {0}", asmCP.Copyright));
 
+            #region 创建数据库目录;
+            string reportFolder = AppDomain.CurrentDomain.BaseDirectory + "DB";
+            if ( !System.IO.Directory.Exists(reportFolder) )
+            {
+                System.IO.Directory.CreateDirectory(reportFolder);
+            }
+            // 创建数据库;
+            if (!System.IO.File.Exists(reportFolder + "\\ReportData.db"))
+            {
+                if (SQLiteHelper.NewDbFile(reportFolder + "\\ReportData.db"))
+                {
+                    SQLiteHelper.NewTable(reportFolder + "\\ReportData.db", "ReportData", "([order] text,url text,content text)");
+                }
+            }
+            #endregion
+
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.Run(new login());