返回行数
代码:
<!DOCTYPE html><html>
<body>
<p>This is all the lines in the text file (with line numbers):</p>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
do while f.AtEndOfStream = false
Response.Write("Line:" & f.Line & " ")
Response.Write(f.ReadLine)
Response.Write("<br>")
loop
f.Close
Set f=Nothing
Set fs=Nothing
%>
</body>
</html>
结果:
This is all the lines in the text file (with line numbers):
Line:1 Hello!
Line:2 How are you today?
相关文章
- ASP.NET Web Pages – 发布
- ASP.NET WebPages 帮助器参考手册
- ASP.NET Razor 语法
- ASP.NET MVC 简介
- ASP.NET MVC 文件夹
- ASP.NET MVC 视图
- WebSecurity GetCreateDate 方法
- ASP.NET HTML 控件 Calendar 2
- ASP.NET HTML 控件 Table
- ASP.NET HTML 控件 SortedList RadioButtonList 1
- C# 实例 可重复使用的头部和底部
- ASP.NET Calendar CellPadding 属性
- ASP.NET Calendar DayHeaderStyle 属性
- ASP.NET CalendarDay IsWeekend 属性
- ASP.NET HyperLink NavigateUrl 属性
- ASP.NET Panel BackImageUrl 属性
- ASP.NET TableRow HorizontalAlign 属性
- ASP.NET TableRow VerticalAlign 属性
- htmltable
- ASP.NET Visible 属性