Ejemplo n.º 1
0
        /// <summary>
        /// 网页返回port
        /// </summary>
        /// <param name="WebAddress">待处理网页地址</param>
        /// <returns></returns>
        public int ReturnPort()
        {
            string      WebAddress          = webAddress;
            LogicCommon logicCommon         = new LogicCommon();
            DataContractJsonSerializer ser1 = new DataContractJsonSerializer(typeof(WebJsonModel));

            using (MemoryStream memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(logicCommon.JsonToString(WebAddress))))
            {
                WebJsonModel webJsonModel = ser1.ReadObject(memoryStream) as WebJsonModel;
                return(webJsonModel.port);
            }
        }