Exemplo n.º 1
0
 public void Start()
 {
     xd = new XdTcpHelper();
     if (xd.Open(Framework.Environment.TCPIP, Framework.Environment.TCPPORT))
     {
         xd.OnConnected    += xd_OnConnected;
         xd.OnDisConnected += xd_OnDisConnected;
         xd.OnReceiveData  += xd_OnReceiveData;
         //xd.Open("127.0.0.1", 9999);
         xd.OnReceiveLogin                    += xd_OnReceiveLogin;
         xd.OnReceiveGetDevChargeInfo         += xd_OnReceiveGetDevChargeInfo;
         xd.OnReceiveGetDevVersion            += xd_OnReceiveGetDevVersion;
         xd.OnReceiveNoteDevChargeStatus      += xd_OnReceiveNoteDevChargeStatus;
         xd.OnReceiveNoteDevStatus            += xd_OnReceiveNoteDevStatus;
         xd.OnReceiveSubscribrDevChargeStatus += xd_OnReceiveSubscribrDevChargeStatus;
         xd.OnReceiveSubscribrDevStatus       += xd_OnReceiveSubscribrDevStatus;
         xd.OnReceiveSetDevParam              += xd_OnReceiveSetDevParamRet;
         xd.OnReceiveGetDevParam              += xd_OnReceiveGetDevParam;
         xd.OnReceiveGetChargePrice           += xd_OnReceiveGetChargePrice;
         xd.OnReceiveSetChargePrice           += xd_OnReceiveSetChargePrice;
         xd.OnReceiveSetBlackList             += xd_OnReceiveSetBlackList;
         xd.OnReceiveSetDevID                 += xd_OnReceiveSetDevID;
         xd.OnReceiveSetServiceState          += xd_OnReceiveSetServiceState;
         Login();
     }
     else
     {
         throw new Exception("无法连接管理服务器!");
     }
 }