Exemple #1
0
        /// <summary>
        /// 写入登录信息
        /// </summary>
        /// <param name="sectionName"></param>
        /// <param name="value">账号信息(数字json)</param>
        /// <param name="appKey">加密key->软件唯一编码</param>
        /// <param name="root"></param>
        public static void WriteLoginInfo(List <ServiceIniLoginResponse> list, string appKey, string sectionName = sectionName)
        {
            var json  = JsonConvert.SerializeObject(list);
            var value = AESHelper.Encrypt(json, appKey);

            ServiceIniHelper.Write(sectionName, "loginInfo", value, root: DocumentDefintion.DocumentPath, fileType: Framework.Enums.EnumIniFileType.Cache);
        }
        private static void WriteModuleDescription(string sectionName, string value)
        {
            if (sectionName.Equals(_baseInfo))
            {
                throw new ArgumentNullException("sectionName value is a built-in definition module");
            }

            ServiceIniHelper.Write(sectionName, "description", value);
        }
        /// <summary>
        /// 写入是否是主程序
        /// </summary>
        private static void WriteModuleIsMainProcess(string sectionName, bool isMainProcess)
        {
            if (sectionName.Equals(_baseInfo))
            {
                throw new ArgumentNullException("sectionName value is a built-in definition module");
            }

            ServiceIniHelper.Write(sectionName, "isMainProcess", isMainProcess ? "1" : "0");
        }
 /// <summary>
 /// 写入启动
 /// </summary>
 /// <param name="startProcess"></param>
 public static void WriteStartProcess(string startProcess)
 {
     ServiceIniHelper.Write(_baseInfo, "startProcess", startProcess, fileType: EnumIniFileType.Start);
 }
 /// <summary>
 /// 写入升级标题
 /// </summary>
 /// <param name="title"></param>
 public static void WriteTitle(string title)
 {
     ServiceIniHelper.Write(_baseInfo, "title", title);
 }
 /// <summary>
 /// 写入代理服务器端口地址
 /// </summary>
 /// <param name="port"></param>
 public static void WriteProxyPort(string port)
 {
     ServiceIniHelper.Write(_baseInfo, "port", port);
 }
        //public static void WriteStartProcess(string startProcess)
        //{
        //    ServiceIniHelper.Write(_baseInfo, "startProcess", startProcess);
        //}

        #region 代理服务器
        /// <summary>
        /// 写入代理服务器Ip地址
        /// </summary>
        /// <param name="ip"></param>
        public static void WriteProxyIp(string ip)
        {
            ServiceIniHelper.Write(_baseInfo, "ip", ip);
        }
 /// <summary>
 /// 写入更新得模块列表,多个用|号隔开
 /// </summary>
 /// <param name="module"></param>
 public static void WriteModuleList(string module)
 {
     ServiceIniHelper.Write(_baseInfo, "moduleList", module);
 }
 /// <summary>
 /// 写入升级描述内容
 /// </summary>
 /// <param name="upgradeDescription"></param>
 public static void WriteUpgradeDescription(string upgradeDescription)
 {
     upgradeDescription = DESHelper.DESEncrypt(upgradeDescription);
     ServiceIniHelper.Write(_baseInfo, "description", upgradeDescription);
 }
 /// <summary>
 /// 写入当前得进程文件名称,避免存在文件被重新命名问题
 /// </summary>
 /// <param name="exeName"></param>
 public static void WriteExeName(string exeName)
 {
     ServiceIniHelper.Write(_baseInfo, "exeName", exeName);
 }