易截截图软件、单文件、免安装、纯绿色、仅160KB

从数据库中取值批量生成html文件

1. web.config
<connectionStrings>
<add name ="myconn" connectionString="Data Source=who\SQLEXPRESS; Initial Catalog=dbname;Integrated Security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
2.
string htmlPath = "D:\\htmlFiles";
string[] files = Directory.GetFiles(htmlPath,"*.html");
foreach (string filename in files)
{
File.Delete(filename);
}
3.
  string conn = ConfigurationManager.ConnectionStrings["myconn"].ToString();
SqlConnection sqlconn = new SqlConnection(conn);
SqlCommand scom = new SqlCommand("select * from table",sqlconn);
SqlDataAdapter sda = new SqlDataAdapter(scom);
DataSet ds = new DataSet();
sda.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
writeHtml(ds);
}
4.
foreach (DataRowView drv in dv)
{
int pid = int.Parse(drv["pid"].ToString().Trim());
string id_name = drv["ID_Name"].ToString().Trim();
string en_title = drv["en_title"].ToString().Trim();
string en_contents = drv["en_contents"].ToString();
string htmlName = String.Format("{0:D4}{1}.html",pid,id_name);
htmlName = htmlName.Replace(' ','_');
htmlName = htmlName.Replace('/','_');
htmlName = htmlName.Replace(':','_');
string htmlContents = "<html><head><title>" + en_title + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"><LINK href="\" mce_href="\""css.css\" type=\"text/css\" rel=\"stylesheet\"></head><body><table><tbody><tr valign=\"top\"><td valign=\"top\" height=\"467\" width=\"696\">" + en_contents + "</td></tr></tbody></


相关文档:

用apache 2的mod_ext_filter给html文件加广告。

用apache 2的mod_ext_filter给html文件加广告。
想在静态页面上自动加个广告条,而不必手动修改每个静态页面。
按照这个需求在google上找了一段时候,不得要领。
后来想起来tomcat里有filter的概念的。
就到apache的文档里找。
瞎猫碰到了这个死耗子。
http://httpd.apache.org/docs/2.0/mod/mod_ext_filter.html
由 ......

两个没有父子关系的html之间如何传递数据

比如说现在有两个毫无关系的html页面:a.html;b.html
从a.html跳到b.html时如何在b.html页面中获得a.html传过来的数据呢?
代码如下:
在a.html中有一个连接指向b.html,<a href="b.html?name='wangzheguilai'">转到b</a>
在b.html中就可以通过js这样获得name的值<script>var name=window.location.se ......

fck fckeditor 重写 映射 HTML 无效 失败 解决办法

IIS配置.html的映射问题,其实这个问题可以说是HttpHandlerFactory的在web.config中注册的问题
问题描述:
     一套网站程序使用URL重写,配置了ISAPI映射.html 动作全部,检查文件是否存在 不打勾 如下图
问题: 不对IIS配置.html的映射,IIS站点目录下.html页面都能显示。当配置了.html的映射 ......

html、asp、php、jsp 禁止缓存的方法

HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP:
header("Expires: Mon, 26 Jul 1997 ......

html常用标记

<html>
<head>
<title>标题<title>
</head>
<body>..........文件内容..........
</body>
</html>
1.文件标题
<title>..........</title>
2.文件更新--<meta>
【1】10秒后自动更新一次
<meta http-equiv="refresh" content=10>
【2】10秒后自动连结到另一文件
<meta http-equiv="ref ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号