Example #1
0
        public static bool InitDB()
        {
            try
            {
                if (SQLEngine.Instance.Connection == null)
                {
                    return(false);
                }

                //创建数据库
                string sqlstr = "CREATE DATABASE IF NOT EXISTS " + DATABASE_NAME + ";"
                                + "use " + DATABASE_NAME + ";";
                MySqlCommand cmd = new MySqlCommand(sqlstr, SQLEngine.Instance.Connection);
                cmd.ExecuteNonQuery();
                //创建表
                FaceInfoBase.MakeTable();
                UserInfo.MakeTable();
                MoneyRecord.MakeTable();

                return(true);
            }catch (Exception ex)
            {
                return(false);
            }
        }
Example #2
0
        public static void Test()
        {
            FaceInfoBase.MakeTable();

            Console.WriteLine("这个接口可能没意义,暂时不实现");
        }