コード例 #1
0
        /// <summary>
        /// 取得各通道拆分后的信息
        /// </summary>
        /// <param name="objUser"></param>
        /// <param name="objMsg"></param>
        /// <param name="strMsg"></param>
        private void GetSpliteMsg(SmsUserData objUser, SmsMsgSendStr objMsg, string strMsg)
        {
            SmsSpgate spgate      = new SmsSpgate();
            int       iPhoneCount = 0;

            for (int i = 0; i < 4; i++)
            {
                if (i == 0)
                {
                    iPhoneCount = objMsg.PhoneCount[i] + objMsg.PhoneCount[4];
                }
                else
                {
                    iPhoneCount = objMsg.PhoneCount[i];
                }
                if (iPhoneCount > 0)       //绑定好了通道,//拆分好信息保存进数组
                {
                    SplitMessage(strMsg, objMsg.PhoneSpgate[i].MsgLen, objUser.HasIndex, ref objMsg.MessageArray[i], out objMsg.MsgArrayLen[i]);
                }
            }
        }
コード例 #2
0
        /************************************************************************/
        /*                                                                      */
        /************************************************************************/
        /// <summary>
        /// 从缓存中获取通道信息
        /// </summary>
        /// <param name="strSpgateKey"></param>
        /// <param name="objSpgate"></param>
        /// <returns></returns>
        public static bool GetCacheSpgate(string strSpgateKey, ref Model.SmsSpgate objSpgate)
        {
            bool bExist = false;

            lock (pSpgateList)
            {
                bExist = pSpgateList.ContainsKey(strSpgateKey);
                if (bExist)
                {
                    objSpgate = pSpgateList[strSpgateKey];
                }
            }
            if (!bExist)
            {
                objSpgate = new SmsSpgate().GetModel(strSpgateKey);
                if (objSpgate == null)
                {
                    return(false);
                }
                AddCacheSpgate(objSpgate);
            }
            return(true);
        }
コード例 #3
0
 /// <summary>
 /// 取得各通道拆分后的信息
 /// </summary>
 /// <param name="objUser"></param>
 /// <param name="objMsg"></param>
 /// <param name="strMsg"></param>
 private void GetSpliteMsg(SmsUserData objUser, SmsMsgSendStr objMsg, string strMsg)
 {
     SmsSpgate spgate = new SmsSpgate();
     int iPhoneCount = 0;
     for (int i = 0; i < 4; i++)
     {
         if (i == 0)
         {
             iPhoneCount = objMsg.PhoneCount[i] + objMsg.PhoneCount[4];
         }
         else
         {
             iPhoneCount = objMsg.PhoneCount[i];
         }
         if (iPhoneCount > 0)       //绑定好了通道,//拆分好信息保存进数组
         {
             SplitMessage(strMsg, objMsg.PhoneSpgate[i].MsgLen, objUser.HasIndex, ref objMsg.MessageArray[i], out objMsg.MsgArrayLen[i]);
         }
     }
 }
コード例 #4
0
 /************************************************************************/
 /*                                                                      */
 /************************************************************************/
 /// <summary>
 /// 从缓存中获取通道信息
 /// </summary>
 /// <param name="strSpgateKey"></param>
 /// <param name="objSpgate"></param>
 /// <returns></returns>
 public static bool GetCacheSpgate(string strSpgateKey, ref Model.SmsSpgate objSpgate)
 {
     bool bExist = false;
     lock (pSpgateList)
     {
         bExist = pSpgateList.ContainsKey(strSpgateKey);
         if (bExist)
         {
             objSpgate = pSpgateList[strSpgateKey];
         }
     }
     if (!bExist)
     {
         objSpgate = new SmsSpgate().GetModel(strSpgateKey);
         if (objSpgate==null)
         {
             return false;
         }
         AddCacheSpgate(objSpgate);
     }
     return true;
 }