by KakiSOFT (2 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Wed 19th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Opens a file called "testfile.txt" and reads the first line.
<HEAD>
</HEAD>
<BODY>
<%@ LANGUAGE="VBScript" %>
<%
dim fso
dim infile
set fso = CreateObject("Scripting.FileSystemObject")
set infile = fso.OpenTextfile(Server.MapPath("testfile.txt"))
Response.Write "<B>First line: <FONT COLOR=BLUE>" & infile.readLine() & "</FONT></B>"
%>
</BODY>
</HTML>