示例#1
0
        public Form1()
        {
            InitializeComponent();
            DataRetriveFromReg dreg = new DataRetriveFromReg();

            dreg.ServerConfigRetrieve();

            AppConfigInfo.RegDataSuit.Reset();
            while (AppConfigInfo.RegDataSuit.MoveNext())
            {
            }
            ConfigWriter cf = new ConfigWriter();

            //cf.DBConnectionstringWriter();
            cf.AppSettingWriter("PortNo", "12222");
        }
示例#2
0
        private void ConfigChanger()
        {
            SequenceLog Seqlog = new SequenceLog();

            try
            {
                string HostPort   = string.Empty;
                string DBName     = string.Empty;
                string DBUserName = string.Empty;
                string DBPassword = string.Empty;
                string ServerName = string.Empty;

                DataRetriveFromReg dreg = new DataRetriveFromReg();
                AppConfigInfo.RegDataSuit = dreg.ServerConfigRetrieve();

                AppConfigInfo.RegDataSuit.Reset();
                while (AppConfigInfo.RegDataSuit.MoveNext())
                {
                    switch (AppConfigInfo.RegDataSuit.Key.ToString())
                    {
                    case "DBName":
                        DBName = Convert.ToString(AppConfigInfo.RegDataSuit.Value);
                        break;

                    case "DBUserName":
                        DBUserName = Convert.ToString(AppConfigInfo.RegDataSuit.Value);
                        break;

                    case "DBPassword":
                        DBPassword = Convert.ToString(AppConfigInfo.RegDataSuit.Value);
                        break;

                    case "ServerName":
                        ServerName = Convert.ToString(AppConfigInfo.RegDataSuit.Value);
                        break;

                    default:
                        break;
                    }
                }
                ConfigWriter cfw = new ConfigWriter();
                cfw.DBConnectionstringWriter("SettlementDB", ServerName, DBName, DBUserName, DBPassword);
            }
            catch (Exception ex)
            {
            }
        }