|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/csiniaws/files/ |
Upload File : |
<%
'*******************************************************
'* ASP 101 Sample Code - http://www.asp101.com *
'* *
'* This code is made available as a service to our *
'* visitors and is provided strictly for the *
'* purpose of illustration. *
'* *
'* Please direct all inquiries to [email protected] *
'*******************************************************
%>
<%
' Declare variables for the File System Object and the File to be accessed.
Dim objFSO, objTextFile
' Create an instance of the the File System Object and assign it to objFSO.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Response.Write server.MapPath("bob.txt")
' Open the file
Set objTextFile = objFSO.CreateTextFile("d:\inetpub\wwwroot\webminded\files\bob.txt")
'Set objTextFile = objFSO.CreateTextFile(Server.MapPath("bob.txt"))
%>
Writing to file "textfile.txt".<BR>
Writing line 1....
<% objTextFile.WriteLine "This text is in the file ""textfile.txt""!" %>
done!<BR>
Writing line 2....
<% objTextFile.WriteLine "It was written by a visitor to ASP 101 on " & Date() & " at " & Time() & "." %>
done!<BR>
Writing line 3....
<% objTextFile.WriteLine "Hi Chris!" %>
done!<BR>
Finished!<BR>
<%
' Close the file.
objTextFile.Close
' Release reference to the text file.
Set objTextFile = Nothing
' Release reference to the File System Object.
Set objFSO = Nothing
%>
<BR>
<A HREF="./textfile.asp">Read from the text file.</A><BR>