/// <summary> ///创建首页相册链接静态页面 /// </summary> public int StaticHtmlshouye(string loginname) { try { string TempFileName = CasesTemss.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; GZS.DAL.product.CommStatic dal = new GZS.DAL.product.CommStatic(); TempSoure = TempSoure.Replace("$cntex$", GetImageList(loginname)); //string[] html = htmlFile.Split('/'); //string[] nn = html[2].Split('_'); //string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loginname + "/Photogallery3.htm"; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> ///创建融资相册链接静态页面 /// </summary> public int StaticRZHtmlshouyeList(string loginname, int id) { try { StringBuilder sb = new StringBuilder(); StringBuilder sb1 = new StringBuilder(); string Url = ""; string sql = "SELECT dbo.ImageTab.imageid, dbo.ImageTab.LoginName, dbo.ImageTab.imageName, dbo.ImageTab.Htmlurl,dbo.ImageUrlTab.Imagepath, dbo.ImageUrlTab.imgexplain FROM dbo.ImageTab INNER JOIN dbo.ImageUrlTab ON dbo.ImageTab.imageid = dbo.ImageUrlTab.Imageid where ImageTab.LoginName=@loginname order by imageid desc"; SqlParameter[] para = { new SqlParameter("@loginname", SqlDbType.VarChar, 20) }; para[0].Value = loginname; DataSet ds = GZS.DAL.DBHelper.Query(sql, para); if (ds != null & ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow row = ds.Tables[0].Rows[i]; string Imagepath = row["Imagepath"].ToString().Trim(); Url = row["Htmlurl"].ToString().Trim(); string imageName = row["imageName"].ToString().Trim(); if (i == 0) { sb1.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/big" + Imagepath + "\" alt=\"" + imageName + "\" width=\"549\" height=\"285\" id=\"mainphoto\"\"http://dp.topfo.com/img/" + loginname + "/" + Imagepath + "\" name=\"#\" />"); } sb.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/" + Imagepath + "\" alt=\"" + imageName + "\" width=\"131\" height=\"89\" rel=\"http://dp.topfo.com/img/" + loginname + "/" + Imagepath + "\" name=\"#\" />"); } } string TempFileName = rzxxzsTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; GZS.DAL.product.CommStatic dal = new GZS.DAL.product.CommStatic(); TempSoure = TempSoure.Replace("$cntex$", GetRZImageList(loginname)); TempSoure = TempSoure.Replace("##userName##", loginname.ToString().Trim()); TempSoure = TempSoure.Replace("##imgtop1##", sb1.ToString().Trim()); TempSoure = TempSoure.Replace("##imglist##", sb.ToString().Trim()); string wenjian = PersonSuccess + "rz" + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = PersonSuccess + "rz" + loginname + "/" + Url + ""; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
private string areabe = ConfigurationManager.AppSettings["areabe"].ToString(); //区域概括生成的静态页面存放路径 // private string areaMa = ConfigurationManager.AppSettings["areaMa"].ToString(); //区域概括模版页存放路径 public void AreaHtml(string name, int num) { GZS.DAL.product.CommStatic comm = new GZS.DAL.product.CommStatic(); string areaMa = "J:/topfo/tzWeb/Corporation/cn001/index.htm"; //string areaMa = "F:/zf/topfo001/index.html"; string[] ar = areaMa.Split('/'); string nn = ar[ar.Length - 2].ToString(); string ma = nn.Replace(nn, name); string bb = "J:\\topfo\\tzWeb\\Corporation\\" + ma + "\\index.htm"; // string bb = "F:\\zf\\"+ma+"\\index.html"; string TempFileName = bb.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 #region 替换模版 string TempSoure = Tem; if (num == 1)//产品优势 { string industry = comm.GetListUIByloginName(name); TempSoure = TempSoure.Replace("$industry$", industry); } else if (num == 2)//投资环境 { } else if (num == 3)//园区特色 { string land = comm.GetParkListUIByLoginName(name); TempSoure = TempSoure.Replace("$Land$", land); } else if (num == 4)//投资成本 { string project = comm.GetInvestListUIByLoginName(name); TempSoure = TempSoure.Replace("$Project$", project); } else if (num == 5)//区域概括 { string area = SelArea(name); TempSoure = TempSoure.Replace("$area$", area); } else if (num == 6)//友情链接 { string friend = comm.GetListFriend(name); TempSoure = TempSoure.Replace("$friendship$", friend); } else if (num == 7)//相册图片 { string pic = comm.GetImageList(name); TempSoure = TempSoure.Replace("$pic$", pic); } else if (num == 8)//优惠政策 { string Policy = comm.GetPolicyListUIByLoginName(name); TempSoure = TempSoure.Replace("$Policy$", Policy); } #endregion string wenjian = areabe + name; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + "\\" + "index.htm"; Compage.Writer(htmlpaths, TempSoure); }