Ejemplo n.º 1
0
 /// <summary>
 /// 指令结果解析适配器.
 /// </summary>
 /// <param name="Msg">指令结果集合.</param>
 /// <returns></returns>
 protected override ASyncResult ResultAdapter(string Msg)
 {
     CDResult CdResult = new CDResult();
     MatchCollection m = Regex.Matches(Msg, @"([A-Z\s\/]+)\,", RegexOptions.IgnoreCase | RegexOptions.Multiline);
     if (m.Count == 0&&m.Count<5) return CdResult;
     CdResult.ShortName = m[0].Groups[1].Value;
     CdResult.FullName = m[2].Groups[1].Value;
     CdResult.CityCode = m[3].Groups[1].Value;
     CdResult.CountryCode = m[4].Groups[1].Value;
     return CdResult;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 指令结果解析适配器.
        /// </summary>
        /// <param name="Msg">指令结果集合.</param>
        /// <returns></returns>
        protected override ASyncResult ResultAdapter(string Msg)
        {
            CDResult        CdResult = new CDResult();
            MatchCollection m        = Regex.Matches(Msg, @"([A-Z\s\/]+)\,", RegexOptions.IgnoreCase | RegexOptions.Multiline);

            if (m.Count == 0 && m.Count < 5)
            {
                return(CdResult);
            }
            CdResult.ShortName   = m[0].Groups[1].Value;
            CdResult.FullName    = m[2].Groups[1].Value;
            CdResult.CityCode    = m[3].Groups[1].Value;
            CdResult.CountryCode = m[4].Groups[1].Value;
            return(CdResult);
        }