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=Home5asp.net Generate static HTML pages in ASP The FileSystemObject object for generating static bus is implemented in. In .NET, this type of operation is system.io below is the program code note: This code is non-original! Refer to someone else code: // Generate HTML Pable Public Static Bool Writefilefile (string strText, string strContent, string strAuthor) {string path = HttpContext.Current.Server.MapPath ( "/ news /"); Encoding code = Encoding.GetEncoding ( "gb2312"); // read the 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 named STR Str.Replace ("ShowArticle", strtext); // ShowArticle str = str.replace in the template page ("Biaoti", STRText); str = str.replace ("Content", strcontent); str = str.replace ("author", strauthor); // write file 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 () } Return true; this function is placed in the CONN.CS base class in the code to add news's code: 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: