read.asp
来自「ASP编程实例入门与提高书中的实例源代码」· ASP 代码 · 共 26 行
ASP
26 行
<html>
<head>
<TITLE>txtread.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
whichfile=server.mappath("test.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(whichfile, 1, False)
'上述参数1表示只读,False表示如文件不存在,则不能创建,后面有详细解释
counter=0
do while not thisfile.AtEndOfStream
counter=counter+1
thisline=thisfile.readline
response.write thisline & "<br>"
loop
thisfile.Close
set thisfile=nothing
set fs=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?