asp.net生成html的问题!
来源:百度知道 编辑:UC知道 时间:2024/05/15 10:13:25
如,生成一个html的模板并不能保存主页的连接地址
有高人帮忙指点一下吧,如有成功的源码帮忙发到邮箱
zm0120@163.com将追加悬赏50分
思路很简单,读取模板,用具体的内容替换模板中设置好的字符串{Titile}{Content}之类。
进一步提高效率的话就用正则表达式来操作、将模板内容缓存起来、用StringBuilder等。
读文件用StreamReader,写文件用StreamWriter。
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Net;
namespace Microsoft.PILMS.IO
{
public class PageConversion
{
#region 私有成员
private readonly string HtmlExtensionFormatExceptionMessage = "Html扩展名格式不正确!";
#endregion 私有成员
#region 方法
#region 动态aspx页转换静态Html页
/// <summary>
/// 动态aspx页转换静态Html页
/// </summary>
/// <param name="aspxPagePath">传入一个aspx页路径</param>
/// <param name="outputServerPath">传入一个输出路径