快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

读取一个文本文件的内容

<%
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%">
返回类别: 教程
上一教程: 使用ASP加密算法加密你的数据(一)
下一教程: 聊天室自做 FOLLOW ME

您可以阅读与"读取一个文本文件的内容"相关的教程:
· 怎样读取一个文本文件的内容?
· 怎样读取一个文本文件的内容
· 从文本文件中读取信息并存储入数据库
· ASP中文本文件与数据库文件的数据交换(FSO)
· ASP中文本文件与数据库文件的数据交换
    微笑服务 优质保证 索取样品