Products
Services
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: (3304)
Favorites:

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 )

fname.Close

set fname=nothing

set fs=nothing


See other Scripts in ASP File System

Submit Your Scripts:

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:
*Email:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]