Merhaba,
Aşağıdaki kodlar sanırım tam istediğin işi yapıyor.
http://www.codeproject.com/Articles/...xt-file-in-ASP adresinde detayları bulabilirsin. Yorumları lazım olabilir diye türkçeleştirmeye çalıştım.
Kolay gelsin.
<% Option Explicit
Const Filename = "readme.txt" ' Okunacak dosyanın adı
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
' Sistem nesnesini oluştur
Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject")
' Mantıksal yolu belirle
Dim Filepath
Filepath = Server.MapPath(Filename)
if FSO.FileExists(Filepath) Then
' dosyayı kullanıma hazırla
Dim file
set file = FSO.GetFile(Filepath)
' Dosya ile ilgili bilgileri al
Dim FileSize
FileSize = file.Size
Response.Write "<p><b>Dosya: " & Filename & " (size " & FileSize &" byte)</b></p><hr>"
Response.Write "<pre>"
' Dosyayı aç
Dim TextStream
Set TextStream = file.OpenAsTextStream(ForReading, TristateUseDefault)
' Satır satır oku
Dim i
i = 1
Do While Not TextStream.AtEndOfStream
Dim Line
Line = TextStream.readline
' Her bir satır için işlem yap
Line = Line & vbCRLF
Response.write i & "-"& Line
i = i+1
Loop
Response.Write "</pre><hr>"
Set TextStream = nothing
Else
Response.Write "<h3><i><font color=red> Dosya " & Filename &" bulunamadı yada erişim engellendi.</font></i></h3>"
End If
Set FSO = nothing
%>