万卷书   首页 > 电脑书籍 > Asp > 一个显示原代码的asp程序
 

< %

sub printhtml(strline)

'该子过程用于打印不含有上述四种特殊标记的行

ispace=len(strline)-len(ltrim(strline))

i=1

while(mid(strline,i,1))=chr(9)

ispace=ispace+5

i=i+1

wend

'统计空白的数量

if ispace >0 then

for i=1 to ispace

response.write(" ")

next

end if

ipos=instr(strline,"<")

if ipos then

response.write(left(strline,ipos-1))

response.write("<")

'用<来替代<,使浏览器不解释< >中的标记

strline=right(strline,len(strline)-ipos)

call printhtml(strline)

'自调用,直到没有<的出现

else

response.write(strline)

end if

end sub

% >

上一页 下一页