Contact Us

Scripts: Asp :: Asp file system :: Library Article #3

Developer's Section

Write text to a file in ASP
By: Erobo Team Member

Hire a Developer for Related Work / Installation | $55 hr
Rating:  | Rate It:   
Average Votes: (3122)

Learn simple steps to write text to a file in asp

In this tutorial we will learn how to write text to a file in ASP.

 Code Snippet 1

dim fs,fname, mypath, newfile

'Create File Object
set fs=Server.CreateObject("Scripting.FileSystemObject")

newfile = "myfile.txt"

'build path for your new file

mypath = Server.MapPath("/mydirectory/") & newfile

'Create text file if it doesnt exist
set fname=fs.CreateTextFile(mypath,true)

fname.WriteLine("New file text" & vbCrlf )


set fname=nothing

set fs=nothing

See other Scripts in Asp file system

Submit Your Scripts:

System Message:
  • Your ASP & ASP.NET script has been sent. Please allow 48 hours for processing.

If you would like to have your ASP & ASP.NET scripts published in this section please fill out
the form below:
*Your Name or Username:
Home Town:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]