Open, Read and Create Files with ASP

Tutorials Shared by the Internet Community

Advertisements


Synopsis

This tutorial explains opening, reading and creating files using example codes. Up to 6 examples are used.

Statistics

  • Total Hits - 22449

  • Total Votes - 101 votes

  • Vote Up - 43 votes

  • Vote Down - 58 votes

  • Domain - www.asptutorial.info

  • Category - ASP/File Manipulation

  • Submitted By - Devesh Khanna

  • Submitted on - 2008-03-06 11:26:15

Description

This one will be the basic code we need to open a text file:

<%
Set fs = CreateObject("Scripting.FileSystemObject")

Set wfile = fs.OpenTextFile("c:\Mydir\myfile.txt")
filecontent = wfile.ReadAll

wfile.close
Set wfile=nothing
Set fs=nothing

response.write(filecontent)
%> ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements