コード例 #1
0
        private void Createcfg(string FilePath)
        {
            try
            {
                ConfigurationFile cfg = new ConfigurationFile();
                cfg.INSTANCEID = TxtINSTANCEID.Text;
                cfg.ACTION = TxtACTION.Text;
                cfg.HELP = CBHELP.Checked;
                cfg.INDICATEPROGRESS = CBINDICATEPROGRESS.Checked;
                cfg.QUIET = CBQUIET.Checked;
                cfg.QUIETSIMPLE = CBQUIETSIMPLE.Checked;
                cfg.X86 = CBX86.Checked;
                cfg.MEDIASOURCE = TxtMEDIASOURCE.Text;
                cfg.ERRORREPORTING = CBERRORREPORTING.Checked;
                cfg.INSTANCEDIR = TxtINSTANCEDIR.Text;
                cfg.SQMREPORTING = CBSQMREPORTING.Checked;
                cfg.INSTANCENAME = TxtINSTANCENAME.Text;
                cfg.AGTSVCACCOUNT = TxtAGTSVCACCOUNT.Text;
                cfg.AGTSVCSTARTUPTYPE = CBAGTSVCSTARTUPTYPE.Text;
                cfg.ISSVCSTARTUPTYPE = CBISSVCSTARTUPTYPE.Text;
                cfg.ISSVCACCOUNT = TxtISSVCACCOUNT.Text;
                cfg.ASSVCSTARTUPTYPE = CBASSVCSTARTUPTYPE.Text;
                cfg.ASCOLLATION = TxtASCOLLATION.Text;
                cfg.ASDATADIR = TxtASDATADIR.Text;
                cfg.ASLOGDIR = TxtASLOGDIR.Text;
                cfg.ASBACKUPDIR = TxtASBACKUPDIR.Text;
                cfg.ASTEMPDIR = TxtASTEMPDIR.Text;
                cfg.ASCONFIGDIR = TxtASCONFIGDIR.Text;
                cfg.ASPROVIDERMSOLAP = TxtASPROVIDERMSOLAP.Text;
                cfg.SQLSVCSTARTUPTYPE = CBSQLSVCSTARTUPTYPE.Text;
                cfg.FILESTREAMLEVEL = TxtFILESTREAMLEVEL.Text;
                cfg.ENABLERANU = CBENABLERANU.Checked;
                cfg.SQLCOLLATION = TxtSQLCOLLATION.Text;
                cfg.SQLSVCACCOUNT = TxtSQLSVCACCOUNT.Text;
                cfg.SQLSYSADMINACCOUNTS = TxtSQLSYSADMINACCOUNTS.Text;
                cfg.SECURITYMODE = TxtSECURITYMODE.Text;
                cfg.ADDCURRENTUSERASSQLADMIN = CBADDCURRENTUSERASSQLADMIN.Checked;
                cfg.TCPENABLED = TxtTCPENABLED.Text;
                cfg.NPENABLED = TxtNPENABLED.Text;
                cfg.BROWSERSVCSTARTUPTYPE = CBBROWSERSVCSTARTUPTYPE.Text;
                cfg.RSSVCACCOUNT = TxtRSSVCACCOUNT.Text;
                cfg.RSSVCSTARTUPTYPE = CBRSSVCSTARTUPTYPE.Text;
                cfg.RSINSTALLMODE = TxtRSINSTALLMODE.Text;

                cfg.CreateConfigFile(FilePath);
            }
            catch (Exception ex)
            { throw ex; }
        }