´ÓÊý¾Ý¿âÖÐÈ¡ÖµÅúÁ¿Éú³É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></
Ïà¹ØÎĵµ£º
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£meta
±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£meta
µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀࣨĿ
Ç°¼¸ºõËùÓеÄËÑË÷ÒýÇ涼ʹÓÃÍøÉÏ»úÆ÷ÈË×Ô¶¯²éÕÒmetaÖµÀ´¸ ......
×î½ü W3C
Ò»¿ÚÆøÍƳö 7 ¸ö HTML ¹¤×÷²Ý°¸£¬º¸ÇÁË HTML5£¬HTML RDF£¬HTML Microdata£¬HTML Canvas£¬ HTML
Bidi µÈ±ê×¼¡£ÕâЩ²Ý°¸¶àÊýÓë HTML5 Óйأ¬ËäÈ» HTML5 ±ê×¼µÄÕæÕý·¢²¼ÓëʵÏÖ»¹ÓкÜÔ¶µÄ·£¬µ«Õâ¸öδÀ´×îÓÐǰ;µÄ HTML
±ê×¼ÕýÒýÆðÒµ½ç¹ã·ºµÄ¹Ø×¢¡£
W3C ·¢²¼µÄ 7 ¸ö HTML ¹¤×÷²Ý°¸ÊÇ:
HTML5
: HTML 5 ºËÐ ......
IISÅäÖÃ.htmlµÄÓ³ÉäÎÊÌ⣬ÆäʵÕâ¸öÎÊÌâ¿ÉÒÔ˵ÊÇHttpHandlerFactoryµÄÔÚweb.configÖÐ×¢²áµÄÎÊÌâ
ÎÊÌâÃèÊö£º
Ò»Ì×ÍøÕ¾³ÌÐòʹÓÃURLÖØд£¬ÅäÖÃÁËISAPIÓ³Éä.html ¶¯×÷È«²¿£¬¼ì²éÎļþÊÇ·ñ´æÔÚ ²»´ò¹´ ÈçÏÂͼ
ÎÊÌ⣺ ²»¶ÔIISÅäÖÃ.htmlµÄÓ³É䣬IISÕ¾µãĿ¼ÏÂ.htmlÒ³Ã涼ÄÜÏÔʾ¡£µ±ÅäÖÃÁË.htmlµÄÓ³Éä ......
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 ......
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£meta
±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£meta
µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀࣨĿ
Ç°¼¸ºõËùÓеÄËÑË÷ÒýÇ涼ʹÓÃÍøÉÏ»úÆ÷ÈË×Ô¶¯²éÕ ......