ASP读取文件流的自定义方法
来源:网络 作者:匿名 发布日期:2008-09-25 22:43:55 点击量:462
Function fso_file_open(fso_file_open_name)
on error resume next
if fso_file_open_name<>"" then
Set lq_fso=Server.Createobject("Scripting.FilesystemObject")
if lq_fso.FileExists(""&Server.MapPath(""&fso_file_open_name&"")&"") then
Set lq_read = lq_fso.OpenTextFile(""&Server.MapPath(""&fso_file_open_name&"")&"",1,True)
fso_file_open=lq_read.ReadAll
lq_read.Close
else
fso_file_open=""
end if
Set lq_fso=Nothing
else
fso_file_open=""
end if
End Function
on error resume next
if fso_file_open_name<>"" then
Set lq_fso=Server.Createobject("Scripting.FilesystemObject")
if lq_fso.FileExists(""&Server.MapPath(""&fso_file_open_name&"")&"") then
Set lq_read = lq_fso.OpenTextFile(""&Server.MapPath(""&fso_file_open_name&"")&"",1,True)
fso_file_open=lq_read.ReadAll
lq_read.Close
else
fso_file_open=""
end if
Set lq_fso=Nothing
else
fso_file_open=""
end if
End Function
使用:file_string=fso_file_open("doc.txt")
Copyright © 2005 奇点中文网--7dit.com
闽ICP备05001292号
闽ICP备05001292号
