When using FSO to generate an html file, if it contains a template, You need to mention the template, replace the tag, and put the content into it to generate a static page. This is too complicated. Today, we will announce a new idea.
First, create a dynamic file a, such as asp, php, jsp, and so on. This file must have a template style, and also has a function to extract the content to be output, in this case, re-create file B and put only one <textarea> in file B. The <textarea> statement is as follows:
<Textarea name = "content"> <! -- # Include file = "file a" --> </textarea>. Then, include the textarea in the form and create a FSO object on the receive table sheet page. The static file is generated as follows!
<%
StrFilename = "c.html"
Strcontent = InSql (Request. Form ("content "))
If Len (Strcontent) <1 Then
Response. Write "the content to be generated does not exist! "
Response. End ()
End If
Set Fso = Server. CreateObject ("Scripting. FileSystemObject ")
Set CreatFile = Fso. CreateTextFile (server. mappath ("" & StrFilename &""))
CreatFile. write Strcontent
CreatFile. close
Set CreatFile = nothing
Set Fso = Nothing
Response. Write "static page generation is complete! "
%>
This c.html file is generated, and no template is required. You only need to read the dynamic file that is used normally to textarea. No problem has been found yet! The premise is that the server must support FSO.