A program that uses ASP to view the source code of ASP files.

Source: Internet
Author: User
<%
SUB PrintLine (ByVal strLine)
StrLine = server. HTMLEncode (strLine)
StrLine = replace (strLine, "& lt; %", "<font color = # ff0000> & lt; % ")
StrLine = replace (strLine, "% & gt;", "% & gt; </FONT> ")
StrLine = replace (strLine, "& lt; SCRIPT", "<font color = # 0000ff> & lt; SCRIPT", 1,-1, 1)
StrLine = replace (strLine, "& lt;/SCRIPT & gt;", "& lt;/SCRIPT & gt; </FONT>", 1,-1, 1)
StrLine = replace (strLine, "& lt ;! -- "," <Font color = #008000> & lt ;! -- ", 1,-1, 1)
StrLine = replace (strLine, "-- & gt;", "-- & gt; </FONT>", 1,-1, 1)
Response. Write strLine
END SUB
Function ShowCode (filename)
Dim strFilename
Dim FileObject, oInStream, strOutput
StrFilename = filename
Set FileObject = Server. CreateObject ("Scripting. FileSystemObject ")
Set oInStream = FileObject. OpenTextFile (strFilename, 1, 0, 0)
While NOT oInStream. AtEndOfStream
StrOutput = oInStream. ReadLine
Call PrintLine (strOutput)
Response. Write ("<BR> ")
Wend
End function
%>
<HTML>
<HEAD>
<TITLE> ASP Source code browser </TITLE>
</HEAD>
<Body bgcolor = # FFFFFF>
<Form action = viewcode. asp method = post>
Enter the ASP file name
<Input type = file name = filename>
<Input type = submit value = "View Source program">
</Form>
<%
On error resume next
Dim file
File = request. form ("filename ")
Response. write file & "source program If trim (file) <> "then
Call showcode (file)
End if
%>
</FONT>
</BODY>
</HTML>

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.