コード例 #1
0
 public bool Connect()
 {
     try
     {
         tdConn.InitConnectionEx(tconf.QCConnect.ServerAddr);
         tdConn.Login(tconf.QCConnect.LoginName, tconf.QCConnect.Password);
         if (tdConn.Connected)
         {
             isConnectToQC = true;
         }
         tdConn.Connect(tconf.QCConnect.Domain, tconf.QCConnect.Project);
         if (tdConn.ProjectConnected)
         {
             isConnectProject = true;
         }
         if (tdConn.Connected && tdConn.ProjectConnected)
         {
             AutoLog.Info("AutoIntSys: Success to connect to QC.");
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         AutoLog.Info("AutoIntSys: Failed to connect to QC.");
         //Debug.Print("AutoIntSys:Failed to connect to QC.");
         if (e.HelpLink == null && e.Message != null)
         {
             AutoLog.Info("AutoIntSys: ---QC Connect Message---");
             AutoLog.Info("AutoIntSys: " + e.Message);
             //Debug.Print("AutoIntSys:---QC Connect Message---");
             //Debug.Print("AutoIntSys:" + e.Message);
         }
         if (e.HelpLink != null)
         {
             Debug.Print("AutoIntSys:---QC Connect HelpLink---");
             string   errMsg   = e.HelpLink;
             string[] printMsg = errMsg.Split(':');
             errMsg = printMsg[1].Trim();
             errMsg = errMsg.Remove(errMsg.Length - 11);
             Debug.Print("AutoIntSys:" + errMsg.Trim());
         }
         return(false);
     }
 }