国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

FSO 讀出TXT文件

2024-05-04 10:59:02
字體:
供稿:網(wǎng)友
<!--#include file="dbconn.asp"-->
<%
function ReadFile(filename)
on error resume next
err.clear
'ASP的一種校錯(cuò)方法
Const ForReading = 2
Const Create = false
Dim FSO
DIM TS
DIM filepath
DIM thefile
Dim content

'---------------操作地址

Set FSO=server.createobject("scripting.filesystemobject")
filepath=server.MapPath("temp") ./記錄本存放的文件夾

if err.number<>0 then
response.Write "目錄不存在"
response.End
end if

'filename="test.txt" ---------test.txt為你從數(shù)據(jù)庫里讀出的文件名
thefile=filepath&"/"&filename
Set TS = FSO.OpenTextFile(thefile,1)

do until Ts.AtEndOfStream
Response.Write (""&TS.ReadLine&"")
response.write("<br>")
loop

Set TS = Nothing
Set FSO = Nothing
end function
%>

<%
dim id
dim filename
id=6
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from yuan where id="&id
rs.open sql,cn,1,1
filename=rs("fileload")
%>

<% readfile(filename) %>


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 包头市| 郑州市| 佛山市| 阿坝| 肥东县| 赣榆县| 郧西县| 诸暨市| 通河县| 新乡市| 师宗县| 洪洞县| 政和县| 横峰县| 定陶县| 静海县| 青铜峡市| 江安县| 曲沃县| 越西县| 河南省| 贵阳市| 盐城市| 嘉禾县| 偏关县| 湘潭市| 布尔津县| 天门市| 南靖县| 寿阳县| 特克斯县| 汽车| 五家渠市| 吉木萨尔县| 九龙坡区| 胶南市| 德保县| 南澳县| 腾冲县| 瑞金市| 临海市|