示例#1
0
        public void Save()
        {
            //监听端口
            m_Configuration.AppSettings.Settings["WatchHousePort"].Value = WatchHousePort.ToString();
            m_Configuration.AppSettings.Settings["PowerPort"].Value      = PowerPort.ToString();

            m_Configuration.AppSettings.Settings["DBSource"].Value   = DBSource;
            m_Configuration.AppSettings.Settings["DBName"].Value     = DBName;
            m_Configuration.AppSettings.Settings["DBPort"].Value     = DBPort.ToString();
            m_Configuration.AppSettings.Settings["DBUserName"].Value = DBUserName;
            m_Configuration.AppSettings.Settings["DBPassword"].Value = DBPassword;

            m_Configuration.AppSettings.Settings["PicUrl"].Value      = PicUrl;
            m_Configuration.AppSettings.Settings["EmployeeUrl"].Value = EmployeeUrl;
            m_Configuration.AppSettings.Settings["AppUrl"].Value      = AppUrl;

            m_Configuration.Save();
        }
示例#2
0
文件: Config.cs 项目: 2830499544/JXHW
        public void Save()
        {
            //数据库配置
            m_Configuration.AppSettings.Settings["DBSource"].Value   = DBSource;
            m_Configuration.AppSettings.Settings["DBName"].Value     = DBName;
            m_Configuration.AppSettings.Settings["DBPort"].Value     = DBPort.ToString();
            m_Configuration.AppSettings.Settings["DBUserName"].Value = DBUserName;
            m_Configuration.AppSettings.Settings["DBPassword"].Value = DBPassword;

            m_Configuration.AppSettings.Settings["RefreshTime"].Value     = RefreshTime.ToString();
            m_Configuration.AppSettings.Settings["OfflineTime"].Value     = OfflineTime.ToString();
            m_Configuration.AppSettings.Settings["TollStationName"].Value = TollStationName;

            //LED文字
            int i = 1;

            foreach (LEDChannelInfo vTempLedText in LedTextArray)
            {
                if (i <= 10)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedText{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedText.Content, vTempLedText.HoldTime, vTempLedText.InEff, vTempLedText.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }

            //LED图片
            i = 1;
            foreach (LEDChannelInfo vTempLedPic in LedPicArray)
            {
                if (i <= 4)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedPic{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedPic.Content, vTempLedPic.HoldTime, vTempLedPic.InEff, vTempLedPic.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }

            //LED视频
            i = 1;
            foreach (LEDChannelInfo vTempLedVideo in LedVideoArray)
            {
                if (i <= 4)
                {
                    m_Configuration.AppSettings.Settings[string.Format("LedVideo{0}", i)].Value = string.Format("{0}|{1}|{2}|{3}", vTempLedVideo.Content, vTempLedVideo.HoldTime, vTempLedVideo.InEff, vTempLedVideo.OutEff);
                }
                else
                {
                    break;
                }
                i++;
            }


            m_Configuration.Save();
        }