| Topic: ASP Let's see an example to read a text file <% dim s Const ForReading = 1 Set fso = CreateObject ( "Scripting.FileSystemObject" ) Set a = fso.OpenTextFile( "c:\testfile.txt" , ForReading) s = ts.ReadLine a.Close set a = nothing set fso = nothing Response.Write "File Content : '" & s & "'" %> To read a specified number of characters from a file, use Read method. To read an entire line (all except the newline character), use ReadLine method. To read the entire contents of a text file, use ReadAll method. Let's have a quick look at how to move, copy and delete files:
Example Program
|
|