<% FileSystemObject.OpenTextFile(Flename,Mode,Create,Format) %>
ForReading
1
Open a file for reading only. You can't write to this file.
ForWriting
2
Open a file for writing.
ForAppending
8
Open a file and write to the end of the file.
TristateUseDefault
-2
Opens the file using the system default.
TristateTrue
-1
Opens the file as Unicode.
TristateFalse
0
Opens the file as ASCII.
<% Option Explicit %> <html> <head> <title>ThaiCreate.Com ASP FileSystemObject Object</title> </head> <body> <% Const ForReading = 1, ForWriting = 2, ForAppending = 8 Dim objFSO,objFile Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(Server.MapPath("MyFiles/thaicreate.txt"), ForWriting, True) objFile.Write "Hello ThaiCreate.Com" Response.write("Files Writed") objFile.Close() Set objFSO = Nothing %> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท