Exemplo n.º 1
0
        /// <summary>
        /// IP设置
        /// </summary>
        private void iniSetting()
        {
            UAIniSetting iniS = new UAIniSetting();

            if (iniS.ShowDialog() == DialogResult.OK)
            {
                var config = ConfigurationManagerExtend.SectionsCast <OpcAddressConfiguration>("Address").FirstOrDefault().Value;
                MessageBox.Show("重启后配置生效~");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 读取配置文件
 /// </summary>
 private void ConfigInit()
 {
     opcConfig = ConfigurationManagerExtend.SectionsCast <OpcAddressConfiguration>("Address").FirstOrDefault().Value;
     if (opcConfig.OpcProtocolByEnum == OpcProtocol.Else)
     {
         UAIniSetting iniS = new UAIniSetting();
         if (iniS.ShowDialog() == DialogResult.OK)
         {
             opcConfig = ConfigurationManagerExtend.SectionsCast <OpcAddressConfiguration>("Address").FirstOrDefault().Value;
         }
         else
         {
             this.Close();
         }
     }
 }