示例#1
0
    public static DcConf GetBdzConfModel(string pathName = "")
    {
        if (string.IsNullOrEmpty(pathName))
        {
            pathName = Application.streamingAssetsPath + "/Conf/DcConf.json";
        }
        string json = U_IO.ReadByFileToString(pathName);

        try
        {
            var    jsonData = JsonMapper.ToObject(json);
            DcConf model    = new DcConf
            {
                version     = jsonData["version"].ToString(),
                sqlUrl      = jsonData["sqlUrl"].ToString(),
                sqlPort     = Convert.ToInt32(jsonData["sqlPort"].ToString()),
                sqlUser     = jsonData["sqlUser"].ToString(),
                sqlPassword = jsonData["sqlPassword"].ToString(),
                sqlDb       = jsonData["sqlDb"].ToString(),
                equipTable  = jsonData["equipTable"].ToString()
            };
            return(model);
        }
        catch (Exception e)
        {
            Debug.LogError(e);
            throw;
        }
    }
示例#2
0
    void OpenSql()
    {
        DcConf conf = DcConf.Ins;

        mySql = new U_MySQL(conf.sqlUrl, conf.sqlPort, conf.sqlUser, conf.sqlPassword, conf.sqlDb);
        mySql.OpenSql();
    }