asp.net 生成静态页 自动分页
2010-03-12 16:35
387 查看
/Files/oneroom/staticPage.rar代码
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ToHtml th = new ToHtml();
th.ReadTemplate("template.html", System.Text.Encoding.UTF8);
string content = "这是第一页[pagerTag]这是第二页[pagerTag]这是第三页[pagerTag]这是第四页";
string[] arr = System.Text.RegularExpressions.Regex.Split(content,@"\[pagerTag\]", System.Text.RegularExpressions.RegexOptions.IgnoreCase|System.Text.RegularExpressions.RegexOptions.Multiline);
int i = 0;
int len = arr.Length;
for (; i < len; ++i)
{
th.ReadTemplate("template.html", System.Text.Encoding.UTF8);
th.startPosition = "<!--content_begin-->";
th.endPosition = "<!--content_end-->";
th.Value = arr[i];
th.replaceTemplate();
th.Value = "替换字符串";
th.ReplaceText(@"\#list\#");
th.Value = th.GetHtmlPager(len, i + 1, "index_", ".html") ;
th.ReplaceText(@"\#pagerTag\#");
th.CreateHtml("./", "index_"+(i+1)+".html", System.Text.Encoding.UTF8);
}
}
}
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ToHtml th = new ToHtml();
th.ReadTemplate("template.html", System.Text.Encoding.UTF8);
string content = "这是第一页[pagerTag]这是第二页[pagerTag]这是第三页[pagerTag]这是第四页";
string[] arr = System.Text.RegularExpressions.Regex.Split(content,@"\[pagerTag\]", System.Text.RegularExpressions.RegexOptions.IgnoreCase|System.Text.RegularExpressions.RegexOptions.Multiline);
int i = 0;
int len = arr.Length;
for (; i < len; ++i)
{
th.ReadTemplate("template.html", System.Text.Encoding.UTF8);
th.startPosition = "<!--content_begin-->";
th.endPosition = "<!--content_end-->";
th.Value = arr[i];
th.replaceTemplate();
th.Value = "替换字符串";
th.ReplaceText(@"\#list\#");
th.Value = th.GetHtmlPager(len, i + 1, "index_", ".html") ;
th.ReplaceText(@"\#pagerTag\#");
th.CreateHtml("./", "index_"+(i+1)+".html", System.Text.Encoding.UTF8);
}
}
}
相关文章推荐
- asp.net生成静态页 分页显示
- Asp.Net 生成静态页并实现分页效果
- ASP.NET生成分页静态页
- Asp.Net 生成静态页并实现分页效果
- ASP.NET生成分页静态页
- Asp.Net 生成静态页并实现分页效果
- 在asp.net中长内容自动分页的实现
- asp.net上传图片并自动生成缩略图和给图片水印
- asp.net中实现上传文档到服务器端的指定文件夹,并且自动生成随机数更改文档的名字
- asp.net 生成静态页
- asp.net MVC中怎样让LINQ Designer自动生成的类从别的类继承并调用其基类构造器?
- asp.net 生成静态页
- asp.net小程序练习--自动生成指定的文本框数
- ASP.NET WebAPI 自动生成帮助文档
- Asp.Net如何生成静态页(转载自多处)
- ASP.NET生成静态页
- asp.net生成静态页
- ASP.NET MVC使用RazorEngine解析模板生成静态页
- Asp.net生成静态页面并对内容分页
- Asp.net中带进度条的批量静态页生成