谁可以教教?? 我例子或视频最好咯
发邮箱 [email protected]
发邮箱 [email protected]
解决方案 »
- 如何去掉母版页里的保存控件状态的那一堆乱码?
- 在线等!再问个gridview的问题。弹出提示窗口确认的问题。
- 关于label的visible值
- 两个页面怎么共享Session?急!!!
- Request的一个问题,在线等待。
- 生死攸关的问题,请各位帮助,谢谢upupup
- 不管是不是高手,主要能解决这两个两个问题的都有分:Loading和刷新的问题,高分!!!在线等
- 请教使用存储过程返回数据集的问题。调试一天了,搞不定,请思归等高手进来指教,UP也有分。
- 首次打开页面很慢,关闭再次打开页面加载很快了,是什么原因造成的呢?
- VS.NET是几张盘呀?
- typed dataset 怎么读取XML数据?
- 如何解决网页打开的速度!
{
string path = HttpContext.Current.Server.MapPath("/news/");
Encoding code = Encoding.GetEncoding("gb2312");
string temp = HttpContext.Current.Server.MapPath("/news/a.html");
StreamReader sr=null;
StreamWriter sw=null;
string str="";
try
{
sr = new StreamReader(temp, code);
str = sr.ReadToEnd();
}
catch(Exception exp)
{
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
sr.Close();
}
string htmlfilename=DateTime.Now.ToString("yyyyMMddHHmmss")+".html";
str =str.Replace("",strText);
str = str.Replace("",strText);
str = str.Replace("",strContent);
str = str.Replace("",strAuthor);
try
{
sw = new StreamWriter(path + htmlfilename , false, code);
sw.Write(str);
sw.Flush();
}
catch(Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
HttpContext.Current.Response.End();
}
finally
{
sw.Close();
}
其实HTML的生成并没有想象中困难,问题是,我上面提到的这个“流程”你是否可以掌握。