Exemple #1
0
        /// <summary>
        /// 在注册表中保存数据库配置信息
        /// </summary>
        /// <param name="dbSvrName"></param>
        /// <param name="dbName"></param>
        /// <param name="dbUserName"></param>
        /// <param name="dbUserPwd"></param>
        /// <returns></returns>
        public static void SaveSetInReg(string dbSvrName, string dbName, string dbUserName, string dbUserPwd)
        {
            Dictionary <string, string> SetDict = new Dictionary <string, string>
            {
                { "1", SetSec(dbSvrName, true) },
                { "2", SetSec(dbName, true) },
                { "3", SetSec(dbUserName, true) },
                { "4", SetSec(dbUserPwd, true) }
            };

            RegDeal.WriteReg(SetDict);
        }
Exemple #2
0
        public static Dictionary <string, string> ReadSetInReg()
        {
            Dictionary <string, string> SetDict = new Dictionary <string, string>();
            var r = RegDeal.ReadRegDict().Where(t => t.Key == "1" || t.Key == "2" || t.Key == "3" || t.Key == "4").Select(t => new
            {
                t.Key,
                t.Value
            });

            SetDict = r.ToDictionary(k => k.Key, v => GetSec(v.Value, true));//解密数据

            return(SetDict);
        }