文件fformat.inc
<script runat=server language=vbscript>
function foot()
dim html
html = "<hr><table border=0 width=100%><tr><td><font size=1>燬ample upload/download via asp from <a href=http://www.pstruh.cz>pstruh software</a>.</font>"
html = html & "</td><td align=right><font size=1><a href=http://www.pstruh.cz/help/scptutl/library.htm>activex upload</a>?a href=http://www.pstruh.cz/help/usrmgr/library.htm>activex usermanager</a>?a href=http://www.pstruh.cz/help/rsconv/library.htm>dbf on-the-fly</a>?a href=http://www.pstruh.cz/help/tcpip/library.htm>activex dns+traceroute</a>?a href=http://www.pstruh.cz/help/urlrepl/library.htm>url replacer</a>?/font>"
html = html & "</td></tr></table></body></html>"
foot = html
end function
function head(title, description)
dim html
html = "<html><head>"
html = html & "<title>" & title & "</title>"
html = html & "<meta content=""" & description & """ name=""description"">"
html = html & style()
html = html & "</head>"
html = html & body()
head = html
end function
function body()
dim html
html = "<body alink=yellow bgcolor=white leftmargin=0 topmargin=0>" &vbcrlf
html = html & clhead() &vbcrlf
html = html & source()
body = html
<leftmargin=0 topmargin=0 style="margin-right:0pt; margin-top:0pt; margin-left:0pt;">
end function
function style()
style = "<style type=""text/css""><–body{font-size:10pt;font-family:arial,arial ce,helvetica,sans-serif }–></style>"
<leftmargin=0 topmargin=0 style="margin-right:0pt; margin-top:0pt; margin-left:0pt;">
end function
function clhead()
dim html
html = html & "<table width=100% border=1 cellpadding=1 cellspacing=0 bordercolor=white><tr bgcolor=silver>"
html = html & "<th><a href=fupload.asp>multiple text files upload</a></th>"
html = html & "<th><a href=fdbupl.asp>upload to database</a></th>"
html = html & "<th><a href=fdbdown.asp>download from database</a></th>"
html = html & "<th><a href=" & request.servervariables("script_name") & "?s=1>view source</a></th>"
html = html & "</tr></table>"
clhead = html
end function
function source()
dim html
if request.querystring("s")<>"" then
html = html & "<pre>" & server.htmlencode(createobject("scripting.filesystemobject").opentextfile _
(server.mappath(request.servervariables("script_name")), 1, false, false).readall) & "</pre>"
end if
source = basicencode(html)
end function
function basicencode(byval vbcode)
dim pom, posstart, posend
posstart = instr(vbcode, "")
do while posstart > 0
posend = instr(posstart + 1, vbcode, vbcrlf)
if posend = 0 then posend = len(vbcode)
pom = left(vbcode, posstart – 1) & "<font color=green>"
pom = pom & mid(vbcode, posstart, posend – posstart – 0) & "</font>"
pom = pom & mid(vbcode, posend)
vbcode = pom
posstart = instr(posend + 1, vbcode, "")
loop
vbcode = filterbeginend(vbcode, "", vbcrlf, "green")
vbcode = filterbeginend(vbcode, """, """, "brown")
vbcode = filterword(vbcode, "set ", "blue")
vbcode = filterword(vbcode, "if ", "blue")
vbcode = filterword(vbcode, "for ", "blue")
vbcode = filterword(vbcode, " then", "blue")
vbcode = filterword(vbcode, " in ", "blue")
vbcode = filterword(vbcode, "each ", "blue")
vbcode = filterword(vbcode, "function ", "blue")
vbcode = filterword(vbcode, "end function", "blue")
vbcode = filterword(vbcode, "msgbox ", "blue")
vbcode = filterword(vbcode, "output ", "blue")
vbcode = filterword(vbcode, "empty", "blue")
vbcode = filterword(vbcode, "debug.print ", "darkblue")
vbcode = filterword(vbcode, "print ", "blue")
vbcode = filterword(vbcode, " and ", "blue")
vbcode = filterword(vbcode, " or ", "blue")
vbcode = filterword(vbcode, "next" & vbcrlf, "blue")
vbcode = filterword(vbcode, "next " , "blue")
vbcode = filterword(vbcode, "response.write", "darkblue")
vbcode = filterword(vbcode, "response.binarywrite" , "darkblue")
vbcode = filterword(vbcode, "response.contenttype" , "darkblue")
vbcode = filterword(vbcode, "response.addheader" , "darkblue")
vbcode = filterword(vbcode, "server.createobject" , "darkblue")
vbcode = filterword(vbcode, "createobject" , "darkblue")
vbcode = filterword(vbcode," = ","red")
basicencode = vbcode
end function
function filterbeginend(byval vbcode, byval sbegin, byval send, byval color)
dim pom, posstart, posend, fontcolor
fontcolor = "<font color=" & color & ">"
posstart = instr(ucase(vbcode), ucase(sbegin))
do while posstart > 0
posend = instr(posstart + len(sbegin), ucase(vbcode), ucase(send))
if posend = 0 then posend = len(vbcode)
pom = left(vbcode, posstart – 1) & fontcolor
pom = pom & mid(vbcode, posstart, posend – posstart + len(send)) & "</font>"
pom = pom & mid(vbcode, posend + len(send))
vbcode = pom
posstart = instr(posend + len(fontcolor) + len("</font>") + len(send), ucase(vbcode), ucase(sbegin))
loop
filterbeginend = vbcode
end function
function filterword(byval vbcode, byval word, byval color)
dim pom, posstart, posend, fontword
fontword = "<font color=" & color & ">" & word & "</font>"
posstart = instr(ucase(vbcode), ucase(word))
do while posstart > 0
pom = left(vbcode, posstart – 1) & fontword
pom = pom & mid(vbcode, posstart + len(word))
vbcode = pom
posstart = instr(posstart + len(fontword), ucase(vbcode), ucase(word))
loop
filterword = vbcode
end function
</script>
