Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 ASP Listing Output to Web
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 15 April 2008 :  22:09:39  Show Profile  Reply with Quote
Seems like about two years ago, there was a mod that would let you specify any asp page and it could be viewed (with line numbers) on the web. This did not require saving as .txt or anything else. Does anyone else remember this one?

I've searched about 10 different ways here and struck out.<

muzishun
Senior Member

United States
1079 Posts

Posted - 15 April 2008 :  22:44:52  Show Profile  Visit muzishun's Homepage  Reply with Quote
I adapted some code several years ago for this. Here is the original topic. I don't have the backup files from that site handy (it no longer exists), but I will check them tomorrow and see if I can track down the vsrc.asp file used in the MOD.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 15 April 2008 22:45:13
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 April 2008 :  00:16:31  Show Profile  Reply with Quote
I found a viewsource asp file on asp101.com. Here's the output of viewsource.asp applied to itself:

<strong>ASP Source Code:</strong>
<hr />
<%
Dim objFSO, objInFile
Dim strIn, strTemp
Dim I, J
Dim strFileName
Dim ProcessString
Dim bCharWritten
Dim bInsideScript
Dim bInsideString
Dim iInsideComment

ProcessString = 0
bCharWritten = False
bInsideScript = False
bInsideString = False
iInsideComment = 0

strFileName = Request.QueryString("file")

' Conditional limiting use of this file
If InStr(1, strFileName, "\", 1) Then strFileName=""
If InStr(1, strFileName, "/", 1) Then strFileName=""

strFileName = Replace(strFileName, "%2E", ".")
strFileName = Replace(strFileName, "%5F", "_")

If strFileName <> "" Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInFile = objFSO.OpenTextFile(Server.MapPath(strFileName))

Response.Write "<PRE>" & vbCRLF
' Loop Through Real File and Output Results to Browser
Do While Not objInFile.AtEndOfStream
strIn = Server.HTMLEncode(objInFile.ReadLine)
' If we find Begin Script Tag start processing
If InStr(1, strIn, "<!-- BEGIN SCRIPT -->", 1) Then
ProcessString = 1
strIn = Server.HTMLEncode(objInFile.ReadLine)
End If
' If we find End Script Tag stop processing
If InStr(1, strIn, "<!-- END SCRIPT -->", 1) Then ProcessString = 0

If ProcessString = 1 Then
strTemp = ""
For I = 1 to Len(strIn)
bCharWritten = False
If InStr(I, strIn, "<%", 1) = I Then
strTemp = strTemp & "<FONT COLOR=#0000FF>"
bInsideScript = True
Else
If InStr(I, strIn, "%>", 1) = I Then
strTemp = strTemp & "%></FONT>"
bCharWritten = True
' so we dont get the trailing end of this tag again!
' ie. Len("%>") - 1 = 4
I = I + 4
bInsideScript = False
End If
End If
' Toggle Inside String if needed!
If bInsideScript And iInsideComment = 0 And InStr(I, strIn, """, 1) = I Then bInsideString = Not bInsideString
' Now do comments if we're in script
If bInsideScript And Not bInsideString And InStr(I, strIn, "'", 1) = I Then
strTemp = strTemp & "<FONT COLOR=#009900>"
iInsideComment = iInsideComment + 1
End If
' End comment at end of line if needed
If iInsideComment > 0 And I = Len(strIN) Then
strTemp = strTemp & Mid(strIn, I, 1)
For J = 1 to iInsideComment
strTemp = strTemp & "</FONT>"
Next 'J
bCharWritten = True
iInsideComment = 0
End If
If bCharWritten = False Then
strTemp = strTemp & Mid(strIn, I, 1)
End If
Next
Response.Write strTemp & vbCRLF
End If
Loop
Response.Write "</PRE>" & vbCRLF

objInFile.Close
Set objInFile = Nothing
Set objFSO = Nothing
Else
strFileName = "index.asp"
End If
%>

Don't know if it's even close to that one from 2004, my memory is playing tricks on me. If you don't find the original, maybe there's a way we can adapt this one.<

Edited by - Carefree on 21 April 2008 17:38:33
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 April 2008 :  00:32:56  Show Profile  Reply with Quote

Edited by - Carefree on 21 April 2008 17:39:07
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 April 2008 :  01:01:23  Show Profile  Reply with Quote
OK - I eliminated the mods pertinent to Oxle & Crash's portal, have what I need except for the line numbering ability.

<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 16 April 2008 :  04:04:51  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Carefree ; I'll have to retrieve the file later today (I'm currently at work, and cannot FTP to the outside world....)<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 April 2008 :  04:29:09  Show Profile  Reply with Quote
Carefree, please refrain from posting the entire contents of files here, instead link to a *.txt or zipped copy of the file.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 April 2008 :  13:32:37  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Or at the very least use the [scrollcode] tags...<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 16 April 2008 :  14:17:55  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Carefree ; here it is: http://oxle.com/source.txt<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 21 April 2008 :  17:35:52  Show Profile  Reply with Quote
Sorry about not scrolling, mind on too many things.

Thanks, Marcel.<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 21 April 2008 :  18:09:33  Show Profile  Visit AnonJr's Homepage  Reply with Quote
quote:
Originally posted by Carefree

Sorry about not scrolling, mind on too many things.

Understandable. It just gets annoying to have to scroll on a monitor that's set to 1600x1200 <
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07