<%
Function WriteToFile (FileName, Contents, Append)
On error resume next
If Append = true then
IMode = 8
Else
IMode = 2
End if
Set oFs = server. createobject ("Scripting. FileSystemObject ")
Set oTextFile = oFs. OpenTextFile (FileName, iMode, True)
OTextFile. Write Contents
OTextFile. Close
Set oTextFile = nothing
Set oFS = nothing
End function
%>
<Html>
<Body>
<%
WriteToFile "C: \ intels \ Test1.txt ","China Water Conservancy and hydropower Press (Www.waterpub.com.cn) -- National Excellent Publishing House", True
WriteToFile "C: \ intels \ Test2.txt ","China Water Conservancy and hydropower Press (Www.waterpub.com.cn) -- National Excellent Publishing House", False
WriteToFile "C: \ intels \ Test1.txt", chr (13) & chr (10 )&"Dancing with the wind (Www.intels.net) -- Personal website of fashion Consulting", True
WriteToFile "C: \ intels \ Test2.txt", chr (13) & chr (10 )&"Dancing with the wind (Www.intels.net) -- Personal website of fashion Consulting", False
'Test1.txt contains:
'China Water Conservancy and hydropower Press (Www.waterpub.com.cn) -- National Excellent Publishing House
'Dancing with the wind (Www.intels.net) -- Personal website of fashion Consulting
'Test2. text contains:
'Dancing with the wind (Www.intels.net) -- Personal website of fashion Consulting
%>
Write to File test is complete
</Body>