public string GetWebImagesXml(CnDataAcess.Entity.CnInterfaceVideoXpath cnXpath, string title, string alt, string src, string hrefpath, string srcpath, string htmlname,int bid,out int id)
        {
            WebClient wc = new WebClient
            {
                Encoding = Encoding.GetEncoding(cnXpath.CnWebEncode)
            };
            string html = wc.DownloadString(cnXpath.CnWebUrl);

            //string html = "";
            //System.IO.StreamReader sr = new System.IO.StreamReader("D:\\CnInterface\\CnWeb\\html\\buildhtml.txt", Encoding.GetEncoding("gb2312"));
            //lock (sr)
            //{
            //    html = sr.ReadToEnd();
            //    sr.Close();
            //}
            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(html);
            string title001 = "";
            string title002 = "";
            string title003 = "";
            string title004 = "";
            string title005 = "";
            string title006 = "";
            if (!title.Equals("") && alt.Equals(""))
            {
                title001 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle001).Attributes["title"].Value;
                title002 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle002).Attributes["title"].Value;
                title003 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle003).Attributes["title"].Value;
                title004 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle004).Attributes["title"].Value;
                title005 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle005).Attributes["title"].Value;
                title006 = cnXpath.CnVideoTitle006.Equals("") ? cnXpath.CnVideoTitle006 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle006).Attributes["title"].Value;
            }
            else if (title.Equals("") && !alt.Equals(""))
            {
                title001 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle001).Attributes["alt"].Value;
                title002 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle002).Attributes["alt"].Value;
                title003 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle003).Attributes["alt"].Value;
                title004 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle004).Attributes["alt"].Value;
                title005 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle005).Attributes["alt"].Value;
                title006 = cnXpath.CnVideoTitle006.Equals("") ? cnXpath.CnVideoTitle006 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle006).Attributes["alt"].Value;
            }
            else
            {
                title001 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle001).InnerText;
                title002 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle002).InnerText;
                title003 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle003).InnerText;
                title004 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle004).InnerText;
                title005 = doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle005).InnerText;
                title006 = cnXpath.CnVideoTitle006.Equals("") ? cnXpath.CnVideoTitle006 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoTitle006).InnerText;
            }
            HtmlToText ht = new HtmlToText();
            title001 = ht.ConvertHtml(title001).Trim();
            title002 = ht.ConvertHtml(title002).Trim();
            title003 = ht.ConvertHtml(title003).Trim();
            title004 = ht.ConvertHtml(title004).Trim();
            title005 = ht.ConvertHtml(title005).Trim();
            title006 = ht.ConvertHtml(title006).Trim();

            string code = htmlname.Replace("Videos", "");
            htmlname = GetWebInfoByCode(code, 0);
            string weburl = GetWebInfoByCode(code, 1);
            StringBuilder sb = new StringBuilder();
               // int id = 0;
            //第一条
            bid++;
            sb.Append("<img id=\"" + bid + "\">");
            sb.Append("<web>" + htmlname + "</web>");
            sb.Append("<title>" + title001 + "</title>");
            sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref001.Equals("") ? cnXpath.CnVideoHref001 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref001).Attributes["href"].Value).Replace("&", "$") + "</url>");
            sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc001.Equals("") ? cnXpath.CnVideoSrc001 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc001).Attributes[src].Value).Replace("&", "$") + "</src>");
            sb.Append("<weburl>" + weburl + "</weburl>");
            sb.Append("</img>");
            //第二条
            bid++;
            sb.Append("<img id=\"" + bid + "\">");
            sb.Append("<web>" + htmlname + "</web>");
            sb.Append("<title>" + title002 + "</title>");
            sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref002.Equals("") ? cnXpath.CnVideoHref002 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref002).Attributes["href"].Value).Replace("&", "$") + "</url>");
            sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc002.Equals("") ? cnXpath.CnVideoSrc002 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc002).Attributes[src].Value).Replace("&", "$") + "</src>");
            sb.Append("<weburl>" + weburl + "</weburl>");
            sb.Append("</img>");
            //第三条
            bid++;
            sb.Append("<img id=\"" + bid + "\">");
            sb.Append("<web>" + htmlname + "</web>");
            sb.Append("<title>" + title003 + "</title>");
            sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref003.Equals("") ? cnXpath.CnVideoHref003 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref003).Attributes["href"].Value).Replace("&", "$") + "</url>");
            sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc003.Equals("") ? cnXpath.CnVideoSrc003 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc003).Attributes[src].Value).Replace("&", "$") + "</src>");
            sb.Append("<weburl>" + weburl + "</weburl>");
            sb.Append("</img>");
            //第四条
            bid++;
            sb.Append("<img id=\"" + bid + "\">");
            sb.Append("<web>" + htmlname + "</web>");
            sb.Append("<title>" + title004 + "</title>");
            sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref004.Equals("") ? cnXpath.CnVideoHref004 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref004).Attributes["href"].Value).Replace("&", "$") + "</url>");
            sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc004.Equals("") ? cnXpath.CnVideoSrc004 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc004).Attributes[src].Value).Replace("&", "$") + "</src>");
            sb.Append("<weburl>" + weburl + "</weburl>");
            sb.Append("</img>");
            //第五条
            bid++;
            sb.Append("<img id=\"" + bid + "\">");
            sb.Append("<web>" + htmlname + "</web>");
            sb.Append("<title>" + title005 + "</title>");
            sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref005.Equals("") ? cnXpath.CnVideoHref005 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref005).Attributes["href"].Value).Replace("&", "$") + "</url>");
            sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc005.Equals("") ? cnXpath.CnVideoSrc005 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc005).Attributes[src].Value).Replace("&", "$") + "</src>");
            sb.Append("<weburl>" + weburl + "</weburl>");
            sb.Append("</img>");
            //第六条
            if (!cnXpath.CnVideoHref006.Equals(""))
            {
                bid++;
                sb.Append("<img id=\"" + bid + "\">");
                sb.Append("<web>" + htmlname + "</web>");
                sb.Append("<title>" + title006 + "</title>");
                sb.Append("<url>" + hrefpath + (cnXpath.CnVideoHref006.Equals("") ? cnXpath.CnVideoHref006 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoHref006).Attributes["href"].Value).Replace("&", "$") + "</url>");
                sb.Append("<src>" + srcpath + (cnXpath.CnVideoSrc006.Equals("") ? cnXpath.CnVideoSrc006 : doc.DocumentNode.SelectSingleNode(cnXpath.CnVideoSrc006).Attributes[src].Value).Replace("&", "$") + "</src>");
                sb.Append("<weburl>" + weburl + "</weburl>");
                sb.Append("</img>");
            }
            id = bid;

            return sb.ToString();
        }