<%
Dim objFSO, objOpenedFile, Filepath, sRead
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const FileName = "\readme.txt"
'파일시스템 객체를 생성한다
Set objFSO = CreateObject("Scripting.FileSystemObject")
Filepath = Server.MapPath(Filename)
'파일이 존재하면
If objFSO.FileExists(Filepath) Then
Response.Write "<pre>"
Set objOpenedFile = objFSO.OpenTextFile(Filepath, ForReading, False, TristateUseDefault)
'라인단위로 읽는다
Do While Not objOpenedFile.AtEndOfStream
sRead = objOpenedFile.readline
sRead = sRead & vbCRLF
Response.write sRead
Loop
Response.Write "</pre>"
Set TextStream = nothing
Else
Response.Write "파일명 " & Filename & " 파일이 없습니다."
End If
Set objFSO = nothing
%>