Scenario 1: ///
} catch (system.exception ex) {erroormsg = ex.Message;} return ";
You can use this function to get the HTML code of the client client, and then save it to the .html file.
Scenario 2: Generate a single static page is not difficult, it is difficult to keep the associations and links between the respective static pages remain complete; especially when frequently updated, modified, or deleted in the page;
As Alibaba's page is all HTML, it is estimated that the function of address mapping for address mapping is available: http://www.easewe.com/article/showArticle.aspx? Article = 131
You can look at this page, analyze his "bidding countdown" function http://info.china.alibaba.com/news/subject/v1-s5011580.html?head=top4&bidding=Home5
ASP.NET Generates a FileSystemObject object for a static HTML page implemented in the ASP! In .NET involving such operations, System.IO is below the program code Note: This code is non-original! Refer to someone else code
CODE: // generates HTML pages public static bool WriteFile (string strText, string strContent, string strAuthor) {string path = HttpContext.Current.Server.MapPath ( "/ news /"); Encoding code = Encoding.GetEncoding ( "gb2312" ); // read template file String Temp = httpContext.current.server.mappath ("/ news / text.html"); streamReader sr = null; streamwriter sw = null; string str = ""; try {sr = new StreamReader (TEMP, CODE); Str = sr.readToEnd (); // Read file} catch (exception exp) {httpContext.current.response.write (EXP.MESSAGE); httpContext.current.Response.end (); Sr.close ();} String htmlfilename = datetime.now.tostring ("YYYYMMDDHHMMSS") ". html"; // Replace content // This time, the template file has been read into the variable name Str = STR = Str.Replace ("ShowArticle", STRText); SHOGLE STR = Str.Replace ("Biaoti", Strtext); str = str.replace ("Content", strcontent); str = str.replace ("content", strcontent); str = str.replace "author", strauthor); // write file try {sw = new streamwriter (Path HTMLFileName, False, Code); SW.WRITE (); } CatCh (Exception EX) {httpcontext.current.response.write (EX.MESSAGE); httpContext.current.response.end ();} finally {sw.close ();} return true; this function is placed in conn.cs The base class is hereby incorporated by reference: an engine name HOVER
if (Hover.Conn.writeFileThis.title.Text.TString), this.content.text.tostring)))) {response.write ("Add success");} else {response. Write ("Generate HTML Error!");
Template page Text.html code
Code: