Exemplo n.º 1
0
        public string sHBRONO        = "0000000000000";//"010332132300000001";//实体编号

        //通用反馈的xml头
        public int xmlHead(XmlDocument xmlDoc, XmlElement xmlElem, EBD ebdsr, string EBDstyle, string strebdid)
        {
            #region 标准头部
            XmlAttribute xmlns = xmlDoc.CreateAttribute("xmlns:xs");
            xmlns.Value = "http://www.w3.org/2001/XMLSchema";
            xmlElem.Attributes.Append(xmlns);

            //Version
            XmlElement xmlProtocolVer = xmlDoc.CreateElement("EBDVersion");
            xmlProtocolVer.InnerText = "1.0";
            xmlElem.AppendChild(xmlProtocolVer);
            //EBDID
            XmlElement xmlEBDID = xmlDoc.CreateElement("EBDID");
            xmlEBDID.InnerText = strebdid;
            xmlElem.AppendChild(xmlEBDID);

            //EBDType
            XmlElement xmlEBDType = xmlDoc.CreateElement("EBDType");
            xmlEBDType.InnerText = EBDstyle;
            xmlElem.AppendChild(xmlEBDType);

            //Source
            XmlElement xmlSRC = xmlDoc.CreateElement("SRC");
            xmlElem.AppendChild(xmlSRC);

            XmlElement xmlSRCAreaCode = xmlDoc.CreateElement("EBEID");
            xmlSRCAreaCode.InnerText = sHBRONO;// "010334152300000002";// ebdsr.SRC.EBEID;
            xmlSRC.AppendChild(xmlSRCAreaCode);
            XmlElement xmlEBDTime = xmlDoc.CreateElement("EBDTime");
            xmlEBDTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            xmlElem.AppendChild(xmlEBDTime);
            #endregion End
            return(0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 通用反馈  收到tar就回
        /// </summary>
        private void CurrencyTarBack(EBD ebdb)
        {
            try
            {
                mainForm.DeleteFolder(mainForm.strBeSendFileMakeFolder);//删除原有XML发送文件的文件夹下的XML
                XmlDocument xmlDoc = new XmlDocument();
                responseXML rp     = new responseXML();
                rp.SourceAreaCode = mainForm.strSourceAreaCode;
                rp.SourceType     = mainForm.strSourceType;
                rp.SourceName     = mainForm.strSourceName;
                rp.SourceID       = mainForm.strSourceID;
                rp.sHBRONO        = mainForm.strHBRONO;

                Random rd    = new Random();
                string fName = "10" + rp.sHBRONO + GetSequenceCodes();
                xmlDoc = rp.CurrencyReback(ebdb, "EBDResponse", fName);
                string xmlSignFileName = "\\EBDB_" + fName + ".xml";

                CreateXML(xmlDoc, mainForm.strBeSendFileMakeFolder + xmlSignFileName);

                //进行签名
                //  mainForm.mainFrm.GenerateSignatureFile(mainForm.strBeSendFileMakeFolder, fName); 测试注释20180812
                mainForm.tar.CreatTar(mainForm.strBeSendFileMakeFolder, mainForm.sSendTarPath, fName);//使用新TAR
                string sSendTarName = mainForm.sSendTarPath + "\\EBDT_" + fName + ".tar";



                FileStream   fsSnd        = new FileStream(sSendTarName, FileMode.Open, FileAccess.Read);
                BinaryReader br           = new BinaryReader(fsSnd); //时间戳
                int          datalen      = (int)fsSnd.Length + 2;
                int          bufferLength = 4096;
                long         offset       = 0; //开始上传时间
                writeHeader(datalen.ToString(), "EBDT_" + fName + ".tar");


                byte[] buffer = new byte[4096]; //已上传的字节数
                int    size   = br.Read(buffer, 0, bufferLength);
                while (size > 0)
                {
                    outputStream.Write(buffer, 0, size);
                    offset += size;
                    size    = br.Read(buffer, 0, bufferLength);
                }
                outputStream.Write(Encoding.UTF8.GetBytes(sEndLine), 0, 2);
                outputStream.Flush(); //提交写入的数据
                fsSnd.Close();        //测试注释  20180608  幺蛾子
            }
            catch (Exception esb)
            {
                Console.WriteLine("401:" + esb.Message);
            }
        }
Exemplo n.º 3
0
        public XmlDocument EBDResponseerror(EBD ebdsr, string EBDstyle, string strEBDID)
        {
            XmlDocument xmlDoc = new XmlDocument();

            //加入XML的声明段落,Save方法不再xml上写出独立属性GB2312
            xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null));
            XmlElement xmlElem = xmlDoc.CreateElement("", "EBD", "");

            xmlDoc.AppendChild(xmlElem);
            xmlHead(xmlDoc, xmlElem, ebdsr, EBDstyle, strEBDID);

            XmlElement xmlRelatedEBD = xmlDoc.CreateElement("RelatedEBD");

            xmlElem.AppendChild(xmlRelatedEBD);

            XmlElement xmlReEBDID = xmlDoc.CreateElement("EBDID");

            xmlReEBDID.InnerText = ebdsr.EBDID;
            xmlRelatedEBD.AppendChild(xmlReEBDID);

            XmlElement xmlEBDResponse = xmlDoc.CreateElement("EBDResponse");

            xmlElem.AppendChild(xmlEBDResponse);

            XmlElement xmlResultCode = xmlDoc.CreateElement("ResultCode");

            xmlResultCode.InnerText = "5";
            xmlEBDResponse.AppendChild(xmlResultCode);

            XmlElement xmlResultDesc = xmlDoc.CreateElement("ResultDesc");

            xmlResultDesc.InnerText = "查找不到该EBMID";
            xmlEBDResponse.AppendChild(xmlResultDesc);

            return(xmlDoc);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 联动接口的通用反馈 新增于20180820
        /// </summary>
        /// <param name="ebdsr"></param>
        /// <param name="EBDstyle"></param>
        /// <param name="strEBDID"></param>
        /// <returns></returns>
        public XmlDocument CurrencyReback(EBD ebdsr, string EBDstyle, string strEBDID)
        {
            XmlDocument xmlDoc = new XmlDocument();

            //加入XML的声明段落,Save方法不再xml上写出独立属性GB2312
            xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null));
            XmlElement xmlElem = xmlDoc.CreateElement("", "EBD", "");

            xmlDoc.AppendChild(xmlElem);
            xmlHead(xmlDoc, xmlElem, ebdsr, EBDstyle, strEBDID);

            XmlElement xmlRelatedEBD = xmlDoc.CreateElement("RelatedEBD");

            xmlElem.AppendChild(xmlRelatedEBD);

            XmlElement xmlReEBDID = xmlDoc.CreateElement("EBDID");

            xmlReEBDID.InnerText = ebdsr.EBDID;
            xmlRelatedEBD.AppendChild(xmlReEBDID);

            XmlElement xmlEBDResponse = xmlDoc.CreateElement("EBDResponse");

            xmlElem.AppendChild(xmlEBDResponse);

            XmlElement xmlResultCode = xmlDoc.CreateElement("ResultCode");

            xmlResultCode.InnerText = "1";
            xmlEBDResponse.AppendChild(xmlResultCode);

            XmlElement xmlResultDesc = xmlDoc.CreateElement("ResultDesc");

            xmlResultDesc.InnerText = "已完成接收";
            xmlEBDResponse.AppendChild(xmlResultDesc);

            return(xmlDoc);


            #region  曲刚写的
            //XmlDocument xmlDoc = new XmlDocument();
            ////加入XML的声明段落,Save方法不再xml上写出独立属性GB2312
            //xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null));
            //XmlElement xmlElem = xmlDoc.CreateElement("", "EBD", "");
            //xmlDoc.AppendChild(xmlElem);
            //xmlHead(xmlDoc, xmlElem, ebd, EBDstyle, strEBDID);

            //XmlElement xmlRelatedEBD = xmlDoc.CreateElement("RelatedEBD");
            //xmlElem.AppendChild(xmlRelatedEBD);

            //XmlElement xmlReEBDID = xmlDoc.CreateElement("EBDID");
            //xmlReEBDID.InnerText = ebd.EBDID;
            //xmlRelatedEBD.AppendChild(xmlReEBDID);

            //XmlElement xmlEBDResponse = xmlDoc.CreateElement("EBDResponse");
            //xmlElem.AppendChild(xmlEBDResponse);

            //XmlElement xmlResultCode = xmlDoc.CreateElement("ResultCode");
            //xmlResultCode.InnerText = "1";
            //xmlEBDResponse.AppendChild(xmlResultCode);

            //XmlElement xmlResultDesc = xmlDoc.CreateElement("ResultDesc");
            //xmlResultDesc.InnerText = "接收解析及数据校验成功";
            //xmlEBDResponse.AppendChild(xmlResultDesc);
            //return xmlDoc;
            #endregion
        }
Exemplo n.º 5
0
        public XmlDocument EBMStateRequestResponse(EBD ebdsr, string strebdid)
        {
            XmlDocument xmlDoc = new XmlDocument();

            #region 标准头部
            //加入XML的声明段落,Save方法不再xml上写出独立属性
            xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null));
            //加入根元素
            XmlElement xmlElem = xmlDoc.CreateElement("", "EBD", "");
            xmlDoc.AppendChild(xmlElem);
            XmlAttribute xmlns = xmlDoc.CreateAttribute("xmlns:xs");
            xmlns.Value = "http://www.w3.org/2001/XMLSchema";
            xmlElem.Attributes.Append(xmlns);

            //Version
            XmlElement xmlProtocolVer = xmlDoc.CreateElement("EBDVersion");
            xmlProtocolVer.InnerText = "1.0";
            xmlElem.AppendChild(xmlProtocolVer);
            //EBDID
            XmlElement xmlEBDID = xmlDoc.CreateElement("EBDID");
            xmlEBDID.InnerText = strebdid;
            xmlElem.AppendChild(xmlEBDID);

            //EBDType
            XmlElement xmlEBDType = xmlDoc.CreateElement("EBDType");
            xmlEBDType.InnerText = "EBMStateResponse";
            xmlElem.AppendChild(xmlEBDType);

            //Source
            XmlElement xmlSRC = xmlDoc.CreateElement("SRC");

            xmlElem.AppendChild(xmlSRC);

            XmlElement xmlSRCAreaCode = xmlDoc.CreateElement("EBRID");
            xmlSRCAreaCode.InnerText = sHBRONO;//ebdsr.SRC.EBEID;
            xmlSRC.AppendChild(xmlSRCAreaCode);


            //EBDTime
            XmlElement xmlEBDTime = xmlDoc.CreateElement("EBDTime");
            xmlEBDTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            xmlElem.AppendChild(xmlEBDTime);
            #endregion End

            #region EBMStateResponse
            XmlElement xmlEBMStateResponse = xmlDoc.CreateElement("EBMStateResponse");
            xmlElem.AppendChild(xmlEBMStateResponse);

            XmlElement xmlEBM = xmlDoc.CreateElement("EBM");
            xmlEBMStateResponse.AppendChild(xmlEBM);

            XmlElement xmlEBMID = xmlDoc.CreateElement("EBMID");
            if (ebdsr.EBMStateRequest != null)
            {
                xmlEBMID.InnerText = ebdsr.EBMStateRequest.EBM.EBMID;//从100000000000开始编号
            }
            else
            {
                xmlEBMID.InnerText = ebdsr.EBM.EBMID;
            }
            xmlEBM.AppendChild(xmlEBMID);

            XmlElement xmlRPTTime = xmlDoc.CreateElement("RptTime");
            xmlRPTTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            xmlEBMStateResponse.AppendChild(xmlRPTTime);

            XmlElement xmlBRDState = xmlDoc.CreateElement("BrdStateCode");
            xmlBRDState.InnerText = "2";
            xmlEBMStateResponse.AppendChild(xmlBRDState);

            XmlElement BrdStateDesc = xmlDoc.CreateElement("BrdStateDesc");
            BrdStateDesc.InnerText = "完成";
            xmlEBMStateResponse.AppendChild(BrdStateDesc);

            #region Coverage

            // if (lEBMState.Count > 0)
            {
                XmlElement xmlCoverage = xmlDoc.CreateElement("Coverage");
                xmlEBMStateResponse.AppendChild(xmlCoverage);

                XmlElement xmlCoveragePercent = xmlDoc.CreateElement("CoveragePercent");
                xmlCoveragePercent.InnerText = "100";
                xmlCoverage.AppendChild(xmlCoveragePercent);

                // string[] AreaValue = lEBMState[0].BRDCoverageArea.Split('|');
                XmlElement xmlAreaCode = xmlDoc.CreateElement("AreaCode");
                if (ebdsr.EBM != null)
                {
                    if (ebdsr.EBM.MsgContent != null)
                    {
                        xmlAreaCode.InnerText = ebdsr.EBM.MsgContent.AreaCode;//"003609810101AA"
                    }
                }
                xmlCoverage.AppendChild(xmlAreaCode);
            }
            #endregion End

            #region Broadcast

            #endregion Broadcast
            #endregion End

            return(xmlDoc);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 河北--应急消息播发状态反馈
        /// </summary>
        /// <returns>返回XML文档</returns>
        public XmlDocument EBMStateResponse(EBD ebdsr, string EBDstyle, string strebdid)
        {
            XmlDocument xmlDoc = new XmlDocument();

            //加入XML的声明段落,Save方法不再xml上写出独立属性GB2312
            xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null));
            XmlElement xmlElem = xmlDoc.CreateElement("", "EBD", "");

            xmlDoc.AppendChild(xmlElem);
            xmlHead(xmlDoc, xmlElem, ebdsr, EBDstyle, strebdid);

            XmlElement xmlRelatedEBD = xmlDoc.CreateElement("RelatedEBD");

            xmlElem.AppendChild(xmlRelatedEBD);

            XmlElement xmlReEBDID = xmlDoc.CreateElement("EBDID");

            xmlRelatedEBD.AppendChild(xmlReEBDID);
            XmlElement xmlEBMStateResponse = xmlDoc.CreateElement("EBMStateResponse");

            xmlElem.AppendChild(xmlEBMStateResponse);

            //反馈数据的时间
            XmlElement xmlRptTime = xmlDoc.CreateElement("RptTime");

            xmlRptTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            xmlEBMStateResponse.AppendChild(xmlRptTime);
            //应急消息内容信息
            XmlElement xmlEBM = xmlDoc.CreateElement("EBM");

            xmlEBMStateResponse.AppendChild(xmlEBM);
            {
                //发布该应急广播消息的应急广播平台ID
                XmlElement xmlEBEID = xmlDoc.CreateElement("EBEID");
                xmlEBEID.InnerText = ebdsr.SRC.EBRID;
                xmlEBM.AppendChild(xmlEBEID);

                //应急消息ID通过应急广播平台ID和应急广播消息ID区别其他的应急广播消息
                XmlElement xmlEBMID = xmlDoc.CreateElement("EBMID");
                xmlEBMID.InnerText = ebdsr.EBM.EBMID;
                xmlEBM.AppendChild(xmlEBMID);
            }

            //播发状态标志,0:播发失败 1:正在播发 2:播发完成,该字段表明当前的应急广播消息播发是否已完成
            XmlElement xmlBrdStateCode = xmlDoc.CreateElement("BrdStateCode");

            xmlBrdStateCode.InnerText = "2";
            xmlEBMStateResponse.AppendChild(xmlBrdStateCode);

            //播发状态描述
            XmlElement xmlBrdStateDesc = xmlDoc.CreateElement("BrdStateDesc");

            xmlEBMStateResponse.AppendChild(xmlBrdStateDesc);

            //实际覆盖行政区域,该数据元素为可选
            XmlElement xmlCoverage = xmlDoc.CreateElement("Coverage");

            xmlEBMStateResponse.AppendChild(xmlCoverage);
            {
                //实际覆盖区域百分比
                XmlElement xmlCoveragePercent = xmlDoc.CreateElement("CoveragePercent");
                xmlCoveragePercent.InnerText = "90%";
                xmlCoverage.AppendChild(xmlCoveragePercent);

                //区域代码,格式为:(区域编码1,区域编码2)
                XmlElement xmlAreaCode = xmlDoc.CreateElement("AreaCode");
                if (ebdsr.EBM.MsgContent.AreaCode != null)
                {
                    xmlAreaCode.InnerText = ebdsr.EBM.MsgContent.AreaCode;
                }
                xmlCoverage.AppendChild(xmlAreaCode);
            }

            //播发数据详情,可选
            XmlElement xmlResBrdInfo = xmlDoc.CreateElement("ResBrdInfo");

            xmlEBMStateResponse.AppendChild(xmlResBrdInfo);
            {
                //播出情况,可为多个,元素关系参见资源信息数据上报
                XmlElement xmlResBrdItem = xmlDoc.CreateElement("ResBrdItem");
                xmlResBrdInfo.AppendChild(xmlResBrdItem);
                {
                    //反馈时间
                    XmlElement xmlARptTime = xmlDoc.CreateElement("RptTime");
                    xmlARptTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    xmlResBrdItem.AppendChild(xmlARptTime);

                    XmlElement xmlEBEST = xmlDoc.CreateElement("EBEST");
                    xmlEBEST.InnerText = "";
                    xmlResBrdItem.AppendChild(xmlEBEST);
                    {
                        XmlElement xmlEBESTEBEID = xmlDoc.CreateElement("EBEID");
                        xmlEBESTEBEID.InnerText = "";
                        xmlEBEST.AppendChild(xmlEBESTEBEID);
                    }

                    XmlElement xmlEBEAS = xmlDoc.CreateElement("EBEAS");
                    xmlEBEAS.InnerText = "";
                    xmlResBrdItem.AppendChild(xmlEBEAS);
                    {
                        XmlElement xmlEBEASEBEID = xmlDoc.CreateElement("EBEID");
                        xmlEBEASEBEID.InnerText = "";
                        xmlEBEAS.AppendChild(xmlEBEASEBEID);
                    }

                    XmlElement xmlEBEBS = xmlDoc.CreateElement("EBEBS");
                    xmlEBEAS.InnerText = "";
                    xmlResBrdItem.AppendChild(xmlEBEBS);
                    {
                        XmlElement xmlEBEBSEBEID = xmlDoc.CreateElement("EBEID");
                        xmlEBEBSEBEID.InnerText = "";
                        xmlEBEBS.AppendChild(xmlEBEBSEBEID);

                        XmlElement xmlStartTime = xmlDoc.CreateElement("StartTime");
                        xmlStartTime.InnerText = "";
                        xmlEBEBS.AppendChild(xmlStartTime);

                        XmlElement xmlEndTime = xmlDoc.CreateElement("EndTime");
                        xmlEndTime.InnerText = "";
                        xmlEBEBS.AppendChild(xmlEndTime);

                        XmlElement xmlFileURL = xmlDoc.CreateElement("FileURL");
                        xmlEBEBS.AppendChild(xmlFileURL);

                        XmlElement xmlResultCode = xmlDoc.CreateElement("ResultCode");
                        xmlResultCode.InnerText = "2";
                        xmlEBEBS.AppendChild(xmlResultCode);

                        XmlElement xmlResultDesc = xmlDoc.CreateElement("ResultDesc");
                        xmlEBEBS.AppendChild(xmlResultDesc);
                    }
                }
            }
            return(xmlDoc);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 收包及反馈
        /// </summary>
        /// <param name="filepath"></param>
        /// <param name="PlatformVerifySignatureresule"></param>
        public void DealTarBack(string filepath, out bool PlatformVerifySignatureresule)
        {
            List <string> AudioFileListTmp = new List <string>(); //收集的音频文件列表

            PlatformVerifySignatureresule = false;                //验签是否通过
            EBD    ebdb     = null;
            string PlayType = "";

            if (File.Exists(filepath))
            {
                try
                {
                    #region 先删除预处理解压缩包中的文件
                    foreach (string xmlfiledel in Directory.GetFileSystemEntries(mainForm.strBeUnTarFolder))
                    {
                        if (File.Exists(xmlfiledel))
                        {
                            FileInfo fi = new FileInfo(xmlfiledel);
                            if (fi.Attributes.ToString().IndexOf("ReadOnly") != -1)
                            {
                                fi.Attributes = FileAttributes.Normal;
                            }
                            File.Delete(xmlfiledel);//直接删除其中的文件
                        }
                    }
                    #endregion End

                    mainForm.tar.UnpackTarFiles(filepath, mainForm.strBeUnTarFolder);                    //把压缩包解压到专门存放接收到的XML文件的文件夹下

                    string[] xmlfilenames      = Directory.GetFiles(mainForm.strBeUnTarFolder, "*.xml"); //从解压XML文件夹下获取解压的XML文件名
                    string   sTmpFile          = string.Empty;
                    string   sAnalysisFileName = "";
                    string   sSignFileName     = "";


                    //签名模块  20180820
                    //if (mainForm.m_UsbPwsSupport == "1")
                    //{
                    //    if (xmlfilenames.Length < 2)//没有签名文件
                    //        PlatformVerifySignatureresule = false;
                    //}

                    for (int i = 0; i < xmlfilenames.Length; i++)
                    {
                        sTmpFile = Path.GetFileName(xmlfilenames[i]);
                        if (sTmpFile.ToUpper().IndexOf("EBDB") > -1 && sTmpFile.ToUpper().IndexOf("EBDS_EBDB") < 0)
                        {
                            sAnalysisFileName = xmlfilenames[i];
                        }
                        //else if (sTmpFile.ToUpper().IndexOf("EBDS_EBDB") > -1)//签名文件
                        //{
                        //    sSignFileName = xmlfilenames[i];//签名文件
                        //}
                    }
                    if (!string.IsNullOrWhiteSpace(sAnalysisFileName))
                    {
                        using (FileStream fsr = new FileStream(sAnalysisFileName, FileMode.Open))
                        {
                            StreamReader sr      = new StreamReader(fsr, Encoding.UTF8);
                            string       xmlInfo = sr.ReadToEnd();
                            xmlInfo = xmlInfo.Replace("xmlns:xs", "xmlns");
                            sr.Close();
                            xmlInfo = XmlSerialize.ReplaceLowOrderASCIICharacters(xmlInfo);
                            xmlInfo = XmlSerialize.GetLowOrderASCIICharacters(xmlInfo);
                            ebdb    = XmlSerialize.DeserializeXML <EBD>(xmlInfo);
                        }
                    }
                    string myEBDType = string.Empty;
                    if (ebdb != null)
                    {
                        myEBDType = ebdb.EBDType;
                    }
                    //   if (!string.IsNullOrWhiteSpace(sSignFileName) && myEBDType != "ConnectionCheck")
                    if (myEBDType != "ConnectionCheck")
                    {
                        //读取xml中的文件,转换为byte字节
                        byte[] xmlArray = File.ReadAllBytes(sAnalysisFileName);
                        PlatformVerifySignatureresule = true; //验签结果
                        #region 签名处理  暂时先注释   20180820
                        //Console.WriteLine("开始验证签名文件!");
                        //using (FileStream SignFs = new FileStream(sSignFileName, FileMode.Open))
                        //{
                        //    StreamReader signsr = new StreamReader(SignFs, Encoding.UTF8);
                        //    string xmlsign = signsr.ReadToEnd();
                        //    signsr.Close();
                        //    responseXML signrp = new responseXML();//签名回复
                        //    XmlDocument xmlSignDoc = new XmlDocument();
                        //    try
                        //    {
                        //        int nDeviceHandle = (int)mainForm.mainFrm.phDeviceHandle;
                        //        xmlsign = XmlSerialize.ReplaceLowOrderASCIICharacters(xmlsign);
                        //        xmlsign = XmlSerialize.GetLowOrderASCIICharacters(xmlsign);
                        //        Signature sign = XmlSerialize.DeserializeXML<Signature>(xmlsign);
                        //        xmlsign = XmlSerialize.ReplaceLowOrderASCIICharacters(xmlsign);
                        //        xmlsign = XmlSerialize.GetLowOrderASCIICharacters(xmlsign);
                        //        string PucStr = sign.SignatureValue;
                        //        byte[] pucsingVi = Encoding.UTF8.GetBytes(sign.SignatureValue);

                        //        //0是签名通过
                        //        var result = mainForm.mainFrm.usb.PlatformVerifySignature(nDeviceHandle, 1, xmlArray, xmlArray.Length, pucsingVi);
                        //        PlatformVerifySignatureresule = result == 0;
                        //        Log.Instance.LogWrite(PlatformVerifySignatureresule ? "签名验证成功" : "签名验证失败-" + result);
                        //    }
                        //    catch (Exception ex)
                        //    {
                        //        Log.Instance.LogWrite("签名文件错误:" + ex.Message);
                        //    }
                        //}
                        //Console.WriteLine("结束验证签名文件!");
                        #endregion End

                        #region 通用反馈
                        CurrencyTarBack(ebdb);
                        #endregion
                    }
                    mainForm.DeleteFolder(mainForm.strBeSendFileMakeFolder);//删除原有XML发送文件的文件夹下的XML
                    #region  最老版本的针对各类消息的反馈
                    if (ebdb != null)
                    {
                        if (ebdb.EBDType == "EBM")
                        {
                            string strMsgType       = ebdb.EBM.MsgBasicInfo.MsgType; //播发类型
                            string strAuxiliaryType = "";
                            if (ebdb.EBM.MsgContent != null)
                            {
                                if (ebdb.EBM.MsgContent.Auxiliary != null)
                                {
                                    strAuxiliaryType = ebdb.EBM.MsgContent.Auxiliary.AuxiliaryType; //实时流播发
                                    if (strAuxiliaryType == "61")
                                    {
                                        PlayType = "1";
                                    }
                                    else
                                    {
                                        PlayType = "2";
                                    }
                                }
                                else
                                {
                                    //有两种情况 停播 文转语
                                    ebdb.EBM.MsgContent.Auxiliary = new Auxiliary();
                                    ebdb.EBM.MsgContent.Auxiliary.AuxiliaryType = "3";
                                    strAuxiliaryType = "3";
                                    ebdb.EBM.MsgContent.Auxiliary.AuxiliaryDesc = "文本转语";
                                    PlayType = "1";
                                }

                                //文转语的情况  只考虑播放
                                if (strMsgType == "1" && PlayType == "1" && ebdb.EBM.MsgContent.Auxiliary.AuxiliaryDesc == "文本转语")
                                {
                                    string[]     pathee = filepath.Split('\\');
                                    string       fill   = pathee[pathee.Length - 1].Split('.')[0];
                                    string       pp     = mainForm.sAudioFilesFolder + "\\" + fill;
                                    RecordDetail tmp    = new RecordDetail();
                                    tmp.SourceTar     = pathee[pathee.Length - 1];
                                    tmp.SourceTarPath = filepath;
                                    tmp.MediumType    = "文本";
                                    tmp.MsgStartTime  = ebdb.EBM.MsgBasicInfo.StartTime;
                                    tmp.MsgEndTime    = ebdb.EBM.MsgBasicInfo.EndTime;
                                    tmp.AreaCode      = ebdb.EBM.MsgContent.AreaCode;
                                    tmp.EventType     = ebdb.EBM.MsgBasicInfo.EventType;
                                    tmp.Severity      = ebdb.EBM.MsgBasicInfo.Severity;
                                    tmp.TextContent   = ebdb.EBM.MsgContent.MsgDesc;
                                    tmp.DealFlag      = 0;
                                    tmp.SenderName    = ebdb.EBM.MsgBasicInfo.SenderName;
                                    tmp.SenderCode    = ebdb.EBM.MsgBasicInfo.SenderCode;
                                    tmp.SendTime      = ebdb.EBM.MsgBasicInfo.SendTime;
                                    tmp.MsgTitle      = ebdb.EBM.MsgContent.MsgTitle;

                                    SingletonInfo.GetInstance().RecordDetailList.Add(tmp);
                                    if (!Directory.Exists(pp))
                                    {
                                        Directory.CreateDirectory(pp);//不存在该路径就创建
                                    }

                                    string docfilepath = pp + "\\" + fill + ".doc";


                                    CreatWord.CreateWordFile(docfilepath, tmp.TextContent);

                                    //FileStream fs = File.Create(pp + "\\" + fill+".txt");    //创建文件
                                    //fs.Close();
                                    //Thread.Sleep(500);
                                    //StreamWriter sw = new StreamWriter(pp + "\\" + fill + ".txt");
                                    //sw.Write(ebdb.EBM.MsgContent.MsgDesc);
                                    //sw.Flush();
                                    //sw.Close();
                                    tmp.SavePath = pp + "\\" + fill + ".doc";
                                    int returncode = SingletonInfo.GetInstance().DataBase.InsertRecorde(tmp);
                                    if (returncode != -1)
                                    {
                                        tmp.RecordId = returncode.ToString();
                                    }
                                    HttpProcessor.MyEvent(tmp);
                                }

                                if (strMsgType == "1" && PlayType == "2")
                                {
                                    string[]     pathee = filepath.Split('\\');
                                    string       fill   = pathee[pathee.Length - 1].Split('.')[0];
                                    string       pp     = mainForm.sAudioFilesFolder + "\\" + fill;
                                    RecordDetail tmp    = new RecordDetail();
                                    tmp.SourceTar     = pathee[pathee.Length - 1];
                                    tmp.SourceTarPath = filepath;
                                    tmp.MediumType    = "mp3";
                                    tmp.MsgStartTime  = ebdb.EBM.MsgBasicInfo.StartTime;
                                    tmp.MsgEndTime    = ebdb.EBM.MsgBasicInfo.EndTime;
                                    tmp.AreaCode      = ebdb.EBM.MsgContent.AreaCode;
                                    tmp.EventType     = ebdb.EBM.MsgBasicInfo.EventType;
                                    tmp.Severity      = ebdb.EBM.MsgBasicInfo.Severity;
                                    tmp.TextContent   = ebdb.EBM.MsgContent.MsgDesc;
                                    tmp.DealFlag      = 0;
                                    tmp.SenderName    = ebdb.EBM.MsgBasicInfo.SenderName;
                                    tmp.SenderCode    = ebdb.EBM.MsgBasicInfo.SenderCode;
                                    tmp.SendTime      = ebdb.EBM.MsgBasicInfo.SendTime;
                                    tmp.MsgTitle      = ebdb.EBM.MsgContent.MsgTitle;
                                    SingletonInfo.GetInstance().RecordDetailList.Add(tmp);
                                    if (!Directory.Exists(pp))
                                    {
                                        Directory.CreateDirectory(pp);//不存在该路径就创建
                                    }
                                    string[] mp3files = Directory.GetFiles(mainForm.strBeUnTarFolder, "*.mp3");
                                    AudioFileListTmp.AddRange(mp3files);
                                    string[] wavfiles = Directory.GetFiles(mainForm.strBeUnTarFolder, "*.wav");
                                    AudioFileListTmp.AddRange(wavfiles);
                                    string savetmp = pp + "\\" + Path.GetFileName(AudioFileListTmp[0]);
                                    System.IO.File.Copy(AudioFileListTmp[0], savetmp, true);
                                    tmp.SavePath = savetmp;
                                    int returncode = SingletonInfo.GetInstance().DataBase.InsertRecorde(tmp);
                                    if (returncode != -1)
                                    {
                                        tmp.RecordId = returncode.ToString();
                                    }
                                    HttpProcessor.MyEvent(tmp);
                                }
                            }
                        }
                    }

                    #endregion
                }
                catch (Exception ep)
                {
                    LogHelper.WriteLog(typeof(HttpProcessor), "处理http异常" + Environment.NewLine + ep.Message);
                }
            }
        }