<%
dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
contents = readfile.ReadLine
readfile.close
Response.Write "The line contains the following text - '" & contents & "'."
%>
<%
dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
contents = readfile.ReadLine
contents2 = readfile.ReadLine.Next
readfile.close
Response.Write "The line contains the following text - '" & contents & "'."
%>
men får felet:
Körningsfel i Microsoft VBScript fel '800a01a8'
Objekt krävs.: '[string: "1234"]'
/text.asp, rad 13
Rad 13:
contents2 = readfile.ReadLine.Next
[string: "1234"]
1234 är det som fins på rad 2 i textfilen