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];
} }
}
{
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];
} }
}
解决方案 »
- TIF图含透明通道,40位,无法读图,转JPG
- 打酱油也给分!高分100分!VS2008!打开一个窗体的时候自动关闭!
- 求win7访问system32文件夹权限解决方案
- Datagridview重绘问题
- 怎样让光盘自动播放?
- 谁能给个思路
- 关于进程调用的一些概念问题
- 请问在Net中,有没有一些好的第三方Grid控件
- 读写XML文件时如如何把xml文件给锁定,让别的程序不能读取。file 有FileShare.XML呢
- C# MemoryCache内存项目无法缓存
- GridView中有好多列,有编辑列 我点击编辑后只对一列进行TextBox操作 现在情况是对整行操作
- Winform窗体的两项设置
你点击了确定按钮...
获取信息中...
若 无法正常连接:提示连接错误...
若 无法获取安装类型:提示类型错误...
一切正常,记录并保存...