惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

博客园 - 胡枫

ASP.NET URL Rewrite. URL重写 asp.net 中DataGrid自定义分页(简单,实用,易懂) 实现类似textarea这样可以滚动显示内容的方法 各种浏览器CSS hack方法 HTML+CSS+JS学习笔记 JS学习笔记ZT Asp.net 备份、还原Ms SQLServer及压缩Access数据库 我该怎样卸载IE7? ASP.NET Application,Session,Cookie和ViewState等对象用法和区别 (转) ASP.NET 防注入的两个通用函数 innerText,outerText,innerHTML,outerHTML 如何在TextBox控件中显示系统当前时间?包括:年、月、日、时、分 ASP.NET 防注入的两个通用函数 C# 操作ACCESS数据库 ASP判断是否包含字符串(InStr 函数) asp.net2.0中Repeater的分页使用 ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子! 一个GridView编辑删除的例子 asp.net中没有类似asp中Left()函数怎么办?
ASP读取显示TXT文件内容
胡枫 · 2007-12-23 · via 博客园 - 胡枫

<html><head><title>基于文本的消息发布系统</title></head>
<body>
<table border="1" cellspacing="0" cellpadding="1" bordercolorlight="#dfdfdf" bordercolordark="#ffffff" align="center">
<tr bgcolor="#cccce6">
<td algin="center" colspan="2">最新消息</td>
</tr>
<%
Set fso=Server.CreateObject("ing.FileSystemObject")
Set fp=fso.OpenTextFile(Server.MapPath("message.txt"))
'打开message.txt

Do While fp.AtEndOfStream<>true
s
=fp.ReadLine '读取一条数据

p
=Instr(s,"*"'取得*号的位置
Messagetitle=Mid(s,1,p-1'取得*号前边的字符串(消息标题)
s=Mid(s,p+1,Len(s)-p) '设变量s为*号后边的字符串

p
=Instr(s,"*")
MessageUrl
=Mid(s,1,p-1'取得*号后边的字符串(链接地址)
s=Mid(s,p+1,Len(s)-p)

ttime

='设定消息发布时间ttime为s
%>
<tr><td><href='<%=MessageUrl%>'><%=Messagetitle%></a></td>
<td><%=ttime%></td>
</tr>
<!--生成表格,把消息显示出来-->
<%
Loop
Fp.close
Set fp=Nothing
Set fso=Nothing
%>
</table>
</body></html>

简单的方法

<%
dim fso,f
    
set fso=server.CreateObject("Scripting.FileSystemObject")
    
Set f =  fso.OpenTextFile(Server.MapPath("1.txt"),1)  
    
Do  While  Not  f.AtEndOfStream    
    response.write f.readline
    
loop
    f.close
    
set f=nothing
    
set fso=nothing
%>