private void btnOK_Click(object sender, System.EventArgs e)   //点击确定按钮
        {
            string[] linarr ={ "UnitCode", "DataSource", "UserName" };
            string[] linvalue;            string strServiceName = txtSrv.Text.Trim();
            string strUserID = txtUID.Text.Trim();
            string strPWD = txtPWD.Text.Trim();            QZ02_Geomag.mag_C_dbOperation dboper = new QZ02_Geomag.mag_C_dbOperation(strServiceName, strUserID, strPWD);
            if (!dboper.OpenConnect())
            {
                MessageBox.Show("数据库连接失败!请检查服务器名、用户名、密码是否正确。", "数据库连接错误", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }            if (dboper.GetNowInstallType == "")
            {
                MessageBox.Show("安装类型错误!", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }            dboper.CloseConnect();
            Form_Main.IsConnect = true;            linvalue = new string[3] { "", strServiceName, strUserID };
            Public_XML.XMLWrite(linarr, linvalue); //记忆参数
            this.Close();
        }
        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Form_Main.IsConnect = false;
            this.Close();
        }        private void DBConnector1_Load(object sender, EventArgs e)
        {
            string[] linarr ={ "UnitCode", "DataSource", "UserName" };
            string[] linvalue;            Public_XML.XMLRead(linarr, out linvalue);            txtSrv.Text = linvalue[1];
            txtUID.Text = linvalue[2];
        }    }
}