校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > 怎樣讀取一個文本文件的內容?

怎樣讀取一個文本文件的內容?

熱門標簽:怎么在地圖標注自己 個人可以辦理400電話么 外呼系統API接口 修改地圖標注 武夷山旅游地圖標注 鳳臺百度地圖標注店 萊西電子地圖標注 金昌電話機器人價格 縣域地圖標注打印店
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.

標簽:南京 涼山 赤峰 清遠 上海 邢臺 通遼 楚雄

巨人網絡通訊聲明:本文標題《怎樣讀取一個文本文件的內容?》,本文關鍵詞  怎樣,讀取,一個,文本,文件,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《怎樣讀取一個文本文件的內容?》相關的同類信息!
  • 本頁收集關于怎樣讀取一個文本文件的內容?的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 南投市| 阿拉善左旗| 和硕县| 涪陵区| 巫溪县| 鲁甸县| 抚宁县| 钟祥市| 武安市| 丁青县| 兴海县| 罗定市| 德惠市| 建宁县| 奉新县| 如皋市| 梅州市| 辰溪县| 新巴尔虎左旗| 通江县| 呈贡县| 晋中市| 沂南县| 开阳县| 太湖县| 陆丰市| 公安县| 湖北省| 额济纳旗| 喜德县| 梓潼县| 耒阳市| 弥勒县| 南昌市| 黄陵县| 神木县| 乌海市| 旬阳县| 墨竹工卡县| 宜兰县| 鹤壁市|