| 123456789101112131415161718192021222324252627282930313233343536373839 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Ips.Library.Entity{    public class CfqAddrInfo    {        public string CfqAddr { get; set; } = "";        public string Addr { get; set; } = "";        public int Port { get; set; } = 0;        public int ChNum { get; set; } = 0;        public static CfqAddrInfo Parse(string cfqAddr)        {            CfqAddrInfo result = new CfqAddrInfo();            if (string.IsNullOrWhiteSpace(cfqAddr))                return result;            result.CfqAddr = cfqAddr;            var itemArr = cfqAddr.Split('-');            if (itemArr.Length >= 2 && int.TryParse(itemArr[1], out int chNum))            {                result.ChNum = chNum;            }            var addrItems = itemArr[0].Split(':');            if (addrItems.Length > 1 && int.TryParse(addrItems[1], out int port))            {                result.Port = port;            }            result.Addr = addrItems[0];            return result;        }    }}
 |