Пример #1
0
        /// <summary>
        /// 获取平台时间
        /// </summary>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <param name="systemTime"></param>
        /// <returns></returns>
        public bool getSystemTime(out int code, out string message, out DateTime systemTime)
        {
            code       = 0;
            message    = "";
            systemTime = DateTime.Now;
            try
            {
                IOControl.saveXmlLogInf("getSystemTime_Send: 18C50\r\n");
                ReturnInfo receiveInf = outlineservice.queryObjectOut(jkxlh, "18C50", "");
                code    = receiveInf.code;
                message = receiveInf.message;
                IOControl.saveXmlLogInf("Received: Code:" + code + "|Message:" + message + "|InfoXML:\r\n" + receiveInf.infoXML + "\r\n");

                if (code == 1)
                {
                    systemTime = System.DateTime.Parse(XmlOperation.CXmlToDatatTable(HttpUtility.UrlDecode(receiveInf.infoXML)).Rows[0]["SystemTime"].ToString());
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception er)
            {
                IOControl.saveXmlLogInf("getSystemTime_Send_Error: \r\n" + er.Message + "\r\n");
                return(false);
            }
        }