最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

怎樣讀取一個(gè)文本文件的內(nèi)容?

 更新時(shí)間:2006年10月28日 00:00:00   作者:  
Ever want to know how to display the contents of a text document using ASP. Here is a easy way to read
from a text file

<!--Start of ASP Code---->

<%
'by James Seymour, http://jamesdot.org

Dim write
Dim fileSysObj, tf, read

' Read the read.txt

' Store the file name where the Information is stored into a variable called read

read = "read.txt"

' Retrieve the fullpath of the read file

read = LEFT(Server.Mappath(Request.ServerVariables("PATH_INFO")), InStrRev(Server.Mappath
(Request.ServerVariables("PATH_INFO")), "\")) & read

' Create an instance of FileSystem Object and store it into a variable called fileSysObj

Set fileSysObj = createObject("Scripting.FileSystemObject")

' Check whether the read file exists

IF (fileSysObj.FileExists(read)) Then
' if the file exists, then open it for reading
Set tf = filesysobj.OpenTextFile(read, 1)
read = tf.ReadLine
tf.Close
ELSE
' if you can't find read.text, display default message
read = "I can't find the file read.txt! So this is my default message."

END IF
%>


' table the displays the read.txt file
<div align="center">
<center>
<table border="0" width="40%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#EEEECC"><B><%=read%></B>
</td>
</tr>
<tr>
<td width="100%">


<!-- End of the ASP -->


use the code above, click and drag your mouse over the code to highlight it. Then right click on the
highlighted code and click "Copy." Now you may paste it into your code editor.

相關(guān)文章

最新評(píng)論

康乐县| 南川市| 临江市| 垦利县| 邵阳市| 孟津县| 赤城县| 广德县| 稻城县| 西华县| 清河县| 揭阳市| 许昌县| 嵩明县| 香格里拉县| 秦皇岛市| 遵化市| 永嘉县| 阳泉市| 泰宁县| 越西县| 克什克腾旗| 清苑县| 曲沃县| 乌拉特前旗| 库车县| 仪征市| 尼玛县| 皮山县| 黑龙江省| 宁阳县| 宜黄县| 阿拉善右旗| 浙江省| 平顺县| 大同市| 浦城县| 贺兰县| 榆树市| 加查县| 丰原市|