Environment: Microsoft .NET Framework SDK V1.1 OS: Windows Server 2003 Chinese version ASP.NET Generates a FileSystemObject object that is implemented in a static HTML page in ASP! In .NET involves this type of operation, SYSTEM. IO is the program code note: This code is non-original! Refer to other person code // Generate HTML Pable Public Static Bool Writefile (String Strauth) {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 // Template file Str = str.replace ("ShowArticle", Strtext) in the name of STR; // ("Biaoti", Strtext); str = str.replace ("Biaoti", StRText); str = str.replace (Str.Rept); "content", strcontent; Str = str.replace ("author", strauthor); // write file try {sw = new streamwriter (Path HTMLFileName, False, Code); sw.flush ();} catch (Exception EX) {httpcontext.current.response.write; httpContext.current.response.end ();} finally {sw.close ();} return true; this function is placed in the conn.cs base class. Quote in the code of adding news Note: Engineering named HOVER IF (Hover.Conn.writeFileTHis.title.Text.TString), this.content.text.toString, this.Author.Text.Tostring))) {response. Write ("Add success");} else {response.write ("Generate HTML Error!");