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

首頁 > 學院 > 編程設計 > 正文

如何讀取文本文件的內容?

2020-06-19 13:51:26
字體:
來源:轉載
供稿:網友

<%
Dim write
Dim fileSysObj, tf, read
read = "intels.txt"
'
讀取intels.txt.

read = LEFT(Server.Mappath(Request.ServerVariables("PATH_INFO")), InStrRev(Server.Mappath(Request.ServerVariables("PATH_INFO")), "/")) & read
'
檢索要讀的文件的完整路徑.

Set fileSysObj = createObject("Scripting.FileSystemObject")
'
創建一個 FileSystem Object 實例,并把它保存到 fileSysObj 的變量中

IF (fileSysObj.FileExists(read)) Then
Set tf = filesysobj.OpenTextFile(read, 1)

' 如果文件在,就打開讀取.

read = tf.ReadLine
tf.Close
ELSE
read = "
,找不到這個文件!"
'
如果文件不存在,發出錯誤提示.
END IF
%>

<html>

<body>

<p align="center">千花飛舞之讀取文本內容</p>

 

<div align="center">

<div align="center">
<center>
<table border="0" width="40%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="green"><B><%=read%></B>
</td>
</tr>
<tr>
<td width="100%">

</table>

</center></div>

</body></html>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浮山县| 资阳市| 柳州市| 全州县| 开封县| 永登县| 广平县| 广东省| 任丘市| 昌乐县| 阿尔山市| 雷波县| 黔西县| 额尔古纳市| 海安县| 富锦市| 红桥区| 宁陕县| 阳东县| 金寨县| 台中县| 玛多县| 澄迈县| 营口市| 林周县| 铁力市| 武定县| 天水市| 莱州市| 玛沁县| 洛南县| 双牌县| 内黄县| 金坛市| 科技| 沂南县| 石屏县| 乐都县| 台安县| 辉县市| 三明市|