<% dim fs,tfile set fs=Server.CreateObject("Scripting.FileSystemObject") set tfile=fs.CreateTextFile("c:\somefile.txt") tfile.WriteLine("Hello World!") tfile.close set tfile=nothing set fs=nothing %>
針對 Folder 對象的實例
<% dim fs,fo,tfile Set fs=Server.CreateObject("Scripting.FileSystemObject") Set fo=fs.GetFolder("c:\test") Set tfile=fo.CreateTextFile("test.txt",false) tfile.WriteLine("Hello World!") tfile.Close set tfile=nothing set fo=nothing set fs=nothing %>
更多建議: