FSO Use Tutorial 9--End FSO Application instance

Source: Internet
Author: User
Tags split
Fso| Tutorials | application examples

End FSO Application Instance-FSO Tutorial 8

Through the previous 8 relevant FSO detailed tutorials, we combine the following things, make a simple production of HTML article system, contains the file title and content, and with modify article function.

Include file:

Addarticle.html ' article content entry form file
Modiarticle.asp ' Modify file content file
Savearticle.asp ' Save new content file
In order to facilitate the tutorial demo, we in the source code unified generated Html file named "fsotohtml.html"

' Addarticle.html source code

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Add new articles </title>

<body>
<form method= "POST" name= "Thefrm" action= "savearticle.asp" >
Article title: <input name= "title" type= "text" value= "" size= ">
Article content: <br/>
<textarea name= "Content" cols= "rows=" ></textarea>
<br/>
<input type= "Submit" name= "Submit" value= "FSO generate write HTML"/>
</form>
</body>

' Savearticle.asp source

<%
'================================================
' Author: Arisisi
' URL: http://www.alixixi.com/
' Source: FSO generates an HTML file sample
' Time: December 17, 2005
'================================================
Set fs = Server.CreateObject ("Scripting.FileSystemObject")
File = Server.MapPath ("fsotohtml.html")
Set txt = fs. OpenTextFile (File,2,true)
Htmlfile = "article title:" &request.form ("title") & "Txt. Write Htmlfile
Set fs = Nothing
Response.Write "<a href=" "fsotohtml.html" "> Successfully generated File" &File& "</a><p>"
Response.Write "<a href=" "modiarticle.asp" > Modify HTML file Content </a> "
%>

Modiarticle.asp ' source

<%
' ================================================
' Author: Arisisi
' URL: http://www.alixixi.com/
' Source: FSO Modify the generated HTML file example
' time: December 17, 2005
' ================================================
Set fs = Server.CreateObject ("Scripting.FileSystemObject")
File = Server.MapPath ("fsotohtml.html")
Set txt = fs. OpenTextFile (file,1,true)
If not txt.atendofstream Then
 content = txt. ReadAll
End If
Set fs = Nothing
 title = Split (Content, "  text = Split (content, "%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Add new article </title>

<body>
<form action= "savearticle.asp" method= "post" name= "Thefrm" >
Article title:
<input name= "Title" type= "text" value= "<%=Title%>" size= ">"
Article content: <br/>
<textarea name= "Content" cols= "rows=" ><%=Text%></textarea>
<br/>
<input type= "Submit" name= "Submit" value= "FSO generate write HTML"/>
</form>
</body>

Through the above three files, we have implemented the generation of HTML files, and with the modification function of the small article system. Come on, let's do it.

To this end, the FSO tutorial is finished, and through these 9 basic articles, extrapolate, you can write more powerful FSO applications or generic classes out. If you have any suggestions or comments on this tutorial, please feel free to comment on this website or forum.

Arisisi
Http://www.alixixi.com
December 17, 2005



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.