<% Function ShowCode(filename) Set fso = Server.CreateObject("Scripting.FileSystemObject") Set cnrs = fso.OpenTextFile(filename, 1) While Not cnrs.AtEndOfStream rsline = cnrs.ReadLine rsline = server.HTMLEncode(rsline) Response.Write(rsline & " ") Wend end Function %>
<% file=request.form("filename") response.write (file & "源程序如下") If trim(file)<> "" then Call ShowCode(file) End If %>
<% If not request.Form("NextLine")="" then Set fso=Server.CreateObject("Scripting.FileSystemobject") textfile1=Server.MapPath("story.txt") set cnrs=fso.OpenTextFile(textfile1,8) cnrs.WriteLine(Request.Form("NextLine")) cnrs.Close end if %> 故事如下: <% Set fso=Server.CreateObject("Scripting.FileSystemObject") textfile1=Server.MapPath("story.txt") set cnrs=fso.OpenTextFile(textfile1,1) while not cnrs.AtEndOfStream Response.Write " " & cnrs.ReadLine wend cnrs.close %>
<% whichfile=server.mappath("site.txt") set fso=createobject("Scripting.FileSystemObject") set thisfile=fso.opentextfile(whichfile) my_string=thisfile.readline
select case request.form("website") case "A": a_value=a_value+1 case "B": b_value=b_value+1 case "C": c_value=c_value+1 case "D": d_value=d_value+1 end select