Beispiel #1
0
 private static void start()
 {
     try
     {
         if (Start == false)
         {
             string ip   = mainForm.txtIp.Text;
             int    port = CommFunc.ConvertDBNullToInt32(mainForm.txtPort.Text);
             int    cnt  = 0;
             while (cnt < 3)
             {
                 ++cnt;
                 bool rst = RdcMethod.Close();
                 if (rst == true)
                 {
                     break;
                 }
                 Thread.Sleep(500);
             }
             RdcMethod.RdcVar = new RdcFunc.RDC_VarOk(resultVar); //放到业务层上去
             RdcMethod.Instance(ip);                              /*初始化*/
             Start = true;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 private static void start()
 {
     try
     {
         if (Start == false)
         {
             string lpFileName = Config.lpFileName;
             string ip         = YDS6000.Models.IniHepler.GetConfig(lpFileName, "rdc", "Ip");
             int    port       = YDS6000.Models.CommFunc.ConvertDBNullToInt32(YDS6000.Models.IniHepler.GetConfig(lpFileName, "rdc", "DataPort"));
             int    cnt        = 0;
             while (cnt < 3)
             {
                 ++cnt;
                 bool rst = RdcMethod.Close();
                 if (rst == true)
                 {
                     break;
                 }
                 Thread.Sleep(500);
             }
             RdcMethod.RdcVar = new RdcFunc.RDC_VarOk(resultVar); //放到业务层上去
             RdcMethod.Instance(ip);                              /*初始化*/
             Start = true;
         }
     }
     catch (Exception ex)
     {
         FileLog.WriteLog("初始化Rdc错误:" + ex.Message + ex.StackTrace);
     }
 }