ASP如何读取TXT文本内容
ASP如何读取TXT文本内容,想实现在线阅读和下载的对象都是TXT文件的效果!望详细一点。谢谢...
ASP如何读取TXT文本内容,想实现在线阅读和下载的对象都是TXT文件的效果!望详细一点。谢谢
展开
1个回答
展开全部
Function ReadAllTextFile
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject( "Scripting.FileSystemObject ")
Set f = fso.OpenTextFile( "c:\testfile.txt ", ForWriting, True)
f.Write "Hello world! "
Set f = fso.OpenTextFile( "c:\testfile.txt ", ForReading)
ReadAllTextFile = f.ReadAll
End Function
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject( "Scripting.FileSystemObject ")
Set f = fso.OpenTextFile( "c:\testfile.txt ", ForWriting, True)
f.Write "Hello world! "
Set f = fso.OpenTextFile( "c:\testfile.txt ", ForReading)
ReadAllTextFile = f.ReadAll
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询