源代码:
This is the first line of the text file:
<% Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1) Response.Write(f.ReadLine) f.Close Set f=Nothing Set fs=Nothing %>
运行结果:
This is the first line of the text file:
<% Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1) Response.Write(f.ReadLine) f.Close Set f=Nothing Set fs=Nothing %>