9_10.asp
来自「《asp网页设计》作者沈才梁源代码,共十章」· ASP 代码 · 共 16 行
ASP
16 行
<%
Dim Path, fso
path=Request.ServerVariables("PATH_TRANSLATED")
'取出目前执行程序所在的实际路径及文件名称
Path = Mid(Path , 1, InstrRev(Path,"\")) '取出目前执行程序所在的实际路径(除去文件名)
filename = Path & "Test1.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fs = fso.OpenTextFile(filename, ForReading)'以读取方式打开文本
Strings = fs.Read(5) '读取前5个文字
Response.Write "读取的前五个文字是:" & Strings & "<Br>"
fs.Close
Set fs = Nothing
Set fso = Nothing
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?