Exemplo n.º 1
0
        /// <summary>
        /// 读取
        /// </summary>
        /// <param name="sectionName"></param>
        /// <returns></returns>
        public static string ReadStartProcess(string sectionName = _baseInfo)
        {
            if (string.IsNullOrWhiteSpace(sectionName))
            {
                throw new ArgumentNullException("sectionName value is not null");
            }

            return(ServiceIniHelper.Read(sectionName, "startProcess", fileType: EnumIniFileType.Start));
        }
Exemplo n.º 2
0
        //public static string ReadStartProcess(string sectionName=_baseInfo)
        //{

        //    if (string.IsNullOrWhiteSpace(sectionName))
        //        throw new ArgumentNullException("sectionName value is not null");

        //    return ServiceIniHelper.Read(sectionName, "startProcess");
        //}

        /// <summary>
        ///
        /// </summary>
        /// <param name="sectionName"></param>
        /// <param name="value"></param>
        public static string ReadModuleDescription(string sectionName)
        {
            if (sectionName.Equals(_baseInfo))
            {
                throw new ArgumentNullException("sectionName value is a built-in definition module");
            }

            return(ServiceIniHelper.Read(sectionName, "description"));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 读取是否是主程序
        /// </summary>
        public static bool ReadModuleIsMainProcess(string sectionName)
        {
            if (sectionName.Equals(_baseInfo))
            {
                throw new ArgumentNullException("sectionName value is a built-in definition module");
            }

            var isMainProcess = ServiceIniHelper.Read(sectionName, "isMainProcess");

            return(isMainProcess.Equals("1"));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 写入升级描述内容
        /// </summary>
        /// <param name="upgradeDescription"></param>
        public static string ReadUpgradeDescription()
        {
            var description = ServiceIniHelper.Read(_baseInfo, "description");

            try
            {
                return(DESHelper.DESDecrypt(description));
            }
            catch { }
            return(description);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 写入更新得模块列表,多个用|号隔开
        /// </summary>
        /// <param name="module"></param>
        public static List <string> ReadModuleList()
        {
            var listStr = ServiceIniHelper.Read(_baseInfo, "moduleList");

            if (string.IsNullOrEmpty(listStr))
            {
                return(null);
            }
            if (listStr.Contains("|"))
            {
                return(listStr.Split('|').ToList());
            }

            return(new List <string>()
            {
                listStr
            });
        }
Exemplo n.º 6
0
        /// <summary>
        /// 写入登录信息
        /// </summary>
        /// <param name="sectionName"></param>
        /// <param name="value">账号信息(数字json)</param>
        /// <param name="appKey">加密key->软件唯一编码</param>
        /// <param name="root"></param>
        public static List <ServiceIniLoginResponse> ReadLoginInfo(string appKey, string sectionName = sectionName)
        {
            var encryptInfo = ServiceIniHelper.Read(sectionName, "loginInfo", root: DocumentDefintion.DocumentPath, fileType: Framework.Enums.EnumIniFileType.Cache, length: 5000);

            if (string.IsNullOrEmpty(encryptInfo))
            {
                return(null);
            }
            var value = AESHelper.Decrypt(encryptInfo, appKey);

            if (string.IsNullOrEmpty(value))
            {
                return(null);
            }
            if (value.Equals(encryptInfo))
            {
                return(null);
            }

            return(JsonConvert.DeserializeObject <List <ServiceIniLoginResponse> >(value));
        }
Exemplo n.º 7
0
 /// <summary>
 /// 获得需要升级得主进程文件名
 /// </summary>
 /// <returns></returns>
 public static string ReadExeName()
 {
     return(ServiceIniHelper.Read(_baseInfo, "exeName"));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 写入升级标题
 /// </summary>
 /// <param name="title"></param>
 public static string ReadTitle()
 {
     return(ServiceIniHelper.Read(_baseInfo, "title"));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 写入代理服务器端口地址
 /// </summary>
 /// <param name="port"></param>
 public static string ReadProxyPort()
 {
     return(ServiceIniHelper.Read(_baseInfo, "port"));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 写入代理服务器Ip地址
 /// </summary>
 /// <param name="ip"></param>
 public static string ReadProxyIp()
 {
     return(ServiceIniHelper.Read(_baseInfo, "ip"));
 }