Ejemplo n.º 1
0
 public bool Connect()
 {
     try
     {
         BalanceResult br = Gateway.GetBalance();
         if (br.Success)
         {
             Console.WriteLine("连接消息 : " + br.Message);
             Console.WriteLine("余额 : " + br.Balance);
             if (Gateway.Config.MOInterval > 0)
             {
                 tmrMO.Start();
             }
             if (Gateway.Config.StatusReportInterval > 0)
             {
                 tmrReport.Start();
             }
             tmrReport.Start();
         }
         return(br.Success);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "Connect Error ->", ex.Message);
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool Connect()
 {
     try
     {
         BalanceResult br = Gateway.GetBalance();
         if (br.Success)
         {
             Console.WriteLine("连接消息 : " + br.Message);
             Console.WriteLine("余额 : " + br.Balance);
         }
         else
         {
             Console.WriteLine("获取余额失败:" + br.Message);
         }
         return(br.Success);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         LogClient.LogHelper.LogInfo(Gateway.Config.GatewayName, "Connect Error ->", ex.Message);
     }
     return(false);
 }