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

首頁 > 編程 > ASP > 正文

FSO 讀出TXT文件

2020-07-27 13:25:14
字體:
來源:轉載
供稿:網友
<!--#include file="dbconn.asp"-->
<%
function ReadFile(filename)
on error resume next
err.clear
'ASP的一種校錯方法
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為你從數據庫里讀出的文件名
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) %>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 内乡县| 博兴县| 武汉市| 湟中县| 苗栗县| 古浪县| 馆陶县| 贺兰县| 静乐县| 新余市| 武汉市| 临朐县| 江源县| 北宁市| 汕头市| 遂平县| 安徽省| 宁阳县| 崇明县| 兰坪| 兴文县| 武冈市| 大名县| 新沂市| 铁力市| 东莞市| 西乡县| 阜平县| 乌拉特中旗| 阜城县| 托克托县| 娄烦县| 施秉县| 安宁市| 万载县| 奎屯市| 翼城县| 探索| 洪湖市| 珠海市| 泉州市|