Beispiel #1
0
        public List <DBInfo> GetAccoutSetting()
        {
            List <DBInfo> list = new List <DBInfo>();
            DBInfo        info;

            foreach (KeyValuePair <string, string> item in ConnectDic)
            {
                info      = new DBInfo();
                info.Guid = item.Key;
                //info.DataBase =
            }
            return(list);
        }
Beispiel #2
0
        /// <summary>
        /// 二进制形式存储链接字符串。
        /// </summary>
        /// <param name="dbinfo"></param>
        public void BinaryWriteDBInfo(DBInfo dbinfo)
        {
            string connectStr = string.Empty;

            switch (dbinfo.ProviderType)
            {
            case LibProviderType.SqlServer:
                connectStr = string.Format(ResFactory.ResManager.GetResByKey(SysConstManage.SQLConnect), dbinfo.ServerAddr, dbinfo.DataBase, dbinfo.UserId, dbinfo.Password);
                break;

            case LibProviderType.Oracle:
                connectStr = string.Format(ResFactory.ResManager.GetResByKey(SysConstManage.OracleConnect), dbinfo.UserId, dbinfo.Password, dbinfo.ServerAddr, dbinfo.DataBase);
                break;
            }
            string connectstr = string.Format(ResFactory.ResManager.GetResByKey(SysConstManage.SaveStr), SysConstManage.DBInfovalSeparator, (int)dbinfo.ProviderType, SysConstManage.DBInfoSeparator, connectStr, (int)dbinfo.ConnectType);

            //BinaryWriteInfo(info);
            EncryptWriteInfo(connectstr, dbinfo.Guid, dbinfo.Key, dbinfo.DataBase.Equals(ResFactory.ResManager.SysDBNm));
        }