sloppycode.net
FSO Reference
Collections
Drives
Files
Folders
Drive
AvailableSpace
DriveLetter
DriveType
FileSystem
FreeSpace
IsReady
Path
RootFolder
SerialNumber
ShareName
TotalSize
VolumeName
File
Attributes
Copy
DateCreated
DateLastAccessed
DateLastModified
Delete
Drive
Move
Name
OpenAsTextStream
ParentFolder
Path
ShortName
ShortPath
Size
Type
Folder
Attributes
Copy
CreateTextFile
DateCreated
DateLastAccessed
DateLastModified
Delete
Drive
Files
IsRootFolder
Move
Name
ParentFolder
Path
ShortName
ShortPath
Size
SubFolders
Type
FSO
BuildPath
Collections
CopyFile
CopyFolder
CreateFolder
CreateTextFile
DeleteFile
DeleteFolder
Drive
DriveExists
Drives
File
FileExists
Folder
FolderExists
GetAbsolutePathName
GetBaseName
GetDrive
GetDriveName
GetExtensionName
GetFile
GetFileName
GetFileVersion
GetFolder
GetParentFolderName
GetSpecialFolder
GetTempName
MoveFile
MoveFolder
OpenTextFile
TextStream
TextStream
AtEndOfLine
AtEndOfStream
Close
Column
Line
Read
ReadAll
ReadLine
Skip
SkipLine
Write
WriteBlankLines
WriteLine
Folder.CreateTextFile(textfilename[, overwrite[, unicode]])
Creates a text file with textfilename inside the folder, and returns a TextStream object, which allows you to use the TextStream object's methods/properties on it. [overwrite] indicates whether the file should be overwritten if it exists (true or false), and unicode indicates whether the file should be created in unicode or ascii (true for unicode)
<% '***************** CreateTextFile Set fso = CreateObject("Scripting.FileSystemObject") Set folderObject = fso.GetFolder(Server.MapPath("\fso") & "\") Set textStreamObject = folderObject.CreateTextFile("testfile.txt",true,false) textStreamObject.WriteLine("a new text file") textStreamObject.Close ' remember to close it so that it writes the file Set textStreamObject = Nothing Set folderObject = Nothing Set fso = Nothing ' Creates a text file called "testfile.txt" in the folder, overwrites if it exists ' and sets it to ascii (false to indicate not unicode). Then write "a new text file" ' to the testfile.txt, and closes it ' NB remember the trailing slash in the GetFolder method %>
› Home
› C#
› Snippets
› Articles
› Tools
› Taglines
› ASP
› Dictionary Object
› FSO
› Unix cheat sheet
› Gaming
› CSS
› Yak
› Umbraco
› About
› Contact
› Privacy
› Projects
› Search
› Sitemap
Buy on Amazon
Buy on Amazon
Buy on Amazon
Buy on Amazon