大家好!如何在asp.net里把aspx生成HTML的后缀名呢! 1、首先做好模板,在页面中标识好哪里放标题,哪里放正文。2、发布信息时读出模板文件,再用正则表达式把标题和正文换成发布的信息。3、以当前时间组织成文件标题存为2007032912121.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将你的aspx生成的页面保存起来WebClient web = new WebClient();web.DownloadFile("http://localhost/mypage.aspx", "20070303.html"); 前面加 using System.IO;public StreamWriter sw=null;string val="";string str_Sql="select E_Memo from Example";SqlDataReader rs=conn.GetDr(str_Sql);if(rs.Read()) val=rs["E_Memo"].ToString(); //取模版rs.Close(); val=val.Replace("$Date$",str_Date);//产生日期val=val.Replace("$Newsid$",str_Newsid);//新闻标题val=val.Replace("$Title$",str_Title);//新闻标题val=val.Replace("$Content$",str_Content);//新闻内容val=val.Replace("$Zznews$",str_ZzNews);//作者val=val.Replace("$Nfrom$",str_Nfrom);//来源val=val.Replace("$About$",str_About);//相关新闻try { //str_Url是保存的页面位置(绝对位置) sw = new StreamWriter(str_Url , false, System.Text.Encoding.GetEncoding("GB2312")); sw.Write(val); sw.Flush(); } catch{ return "产生页面出错!";} 在windows7 iis上部署asp.net网站后发现SqlParameter传参出现了问题 求一个字符正则表达式 怎么才能拥有一台属于自己的服务器? ArrayList ,ilist,DataSet,哪个性能更好点。 哪位能给个Visual Assist .net 注册码?? 如何用TreeView实现浏览文件夹功能。是WEB的! 求一份WebService返回XML-RPC格式的例子? 请教大牛:将多个表的数据集成到一个html表中 更新不到数据库,请教 任何实现TOOPTIP? 帮我看看一个js问题 问两个小问题!
web.DownloadFile("http://localhost/mypage.aspx", "20070303.html");
string str_Sql="select E_Memo from Example";
SqlDataReader rs=conn.GetDr(str_Sql);
if(rs.Read())
val=rs["E_Memo"].ToString(); //取模版
rs.Close();
val=val.Replace("$Date$",str_Date);//产生日期
val=val.Replace("$Newsid$",str_Newsid);//新闻标题
val=val.Replace("$Title$",str_Title);//新闻标题
val=val.Replace("$Content$",str_Content);//新闻内容
val=val.Replace("$Zznews$",str_ZzNews);//作者
val=val.Replace("$Nfrom$",str_Nfrom);//来源
val=val.Replace("$About$",str_About);//相关新闻try
{ //str_Url是保存的页面位置(绝对位置)
sw = new StreamWriter(str_Url , false, System.Text.Encoding.GetEncoding("GB2312"));
sw.Write(val);
sw.Flush();
}
catch
{
return "产生页面出错!";
}