programming-examples/asp/More_Code_Snippets/Display ASP code on an HTML page.asp

21 lines
643 B
Plaintext
Raw Normal View History

2019-11-18 14:25:58 +01:00
<%
'declare our variables
Dim objFSO , objFile , strText
'our page to display
file = Server.MapPath("pagetodisplay.php")
'create an instance of the file system object
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'open the page , for reading
Set objFile = objFSO.OpenTextFile(file , 1 , False)
'while we are not at the end of the file read lines and store in strText
Do While Not objFile.AtEndOfStream
strText = objFile.ReadLine
'display the text
Response.Write Server.HTMLEncode(strText) & "<br>"
Loop
'close
objFile.Close
'destroy objects
Set objFile = Nothing
Set objFSO = Nothing
%>