/// <summary> /// 登录的窗体的加载显示事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginForm_Load(object sender, EventArgs e) { #region 读取配置文件 // 初始化配置文件路径 string filepath = System.IO.Directory.GetCurrentDirectory() + "\\SystemSet.xml"; //string filepath = System.IO.Directory.GetParent("\\SystemSet.xml").ToString(); string rstr = SystemClass.GetSystemSet(filepath);// 调用读取xml配置信息的方法 if (!string.IsNullOrEmpty(rstr)) { MessageBox.Show(rstr, "运行信息", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } GetDataSet(); common.ISService = Internet.PingIpOrDomainName(common.SQLIP); #endregion ControlPLC.GetSystem(); if (common.ISService) { SystemClass.GetPosition(); ControlPLC.DownloadIC(); ControlPLC.DownloadDri(); fvnState(); } else { txtLoginName.Text = "不能连接数据库,请检查网络"; } txtLoginName.TabIndex = 0; }