asp网站标题怎么样随机调用txt内关键字显示为标题,比如同目录下的1.txt 有关键字: 123 325 456 789 459.. 5
1个回答
展开全部
<%
filespec=server.mappath("自己修改路径.txt")
Const ForReading = 1
Dim fso, theFile, retstring
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFile = fso.OpenTextFile(filespec, ForReading, False)
i=0
Do While theFile.AtEndOfStream <> True
session("行"&i) = theFile.ReadLine
i=i+1
Loop
theFile.Close
ReadEntireFile = retstring
for j=0 to i-1
arry=split(session("行"&j),",")
response.write session("行"&j)+"<br>"
next
%>
filespec=server.mappath("自己修改路径.txt")
Const ForReading = 1
Dim fso, theFile, retstring
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFile = fso.OpenTextFile(filespec, ForReading, False)
i=0
Do While theFile.AtEndOfStream <> True
session("行"&i) = theFile.ReadLine
i=i+1
Loop
theFile.Close
ReadEntireFile = retstring
for j=0 to i-1
arry=split(session("行"&j),",")
response.write session("行"&j)+"<br>"
next
%>
追问
好像不行,调用同目录下1.txt内的关键字
1.txt内是例:123123
456456
789789
147789
258789
随机调用某一行为网站标题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询