|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想法是和程序员的想法不一样的.至于为什么.大家去想一想.跟心理学有关的东子于00-9-3上午01:41:46宣布在:ASP地带
用此援用该程序
<AHREF="/ASPScripts/PrintPage.asp?REF=URL_of_Web_Page">
打印
</A>
PrintPage.asp原程序
<%@Language=VBScript%>
<%OptionExplicit%>
<HTML>
<HEAD>
<TITLE>
4GuysFromRolla.comArticle
</TITLE>
</HEAD>
<BODY>
<CENTER>
<TABLEWIDTH=90%BORDER=2CELLSPACING=1BGCOLOR=WHITE>
<TR><TDALIGN=CENTER>
<FONTSIZE=3><I>
Thisarticlewasbroughttoyouby4GuysFromRolla.com!
WhenyouthinkASP,think4GuysFromRolla.com!<BR>
http://www.4GuysFromRolla.com
</FONT></I>
</TD></TR>
</TABLE>
</CENTER>
<P>
<%
ConstForReading=1
DimstrReferrer,objFSO,objOpenFile,strLine
strReferrer=Request.QueryString("REF")
IfLen(strReferrer)<1then
strReferrer=Request.ServerVariables("HTTP_REFERER")
IfLen(strReferrer)<1then
Response.Write"Egad!AnErroroccurred!Wecouldnot"&_
"determinewhatpageyouwantedtoviewthesourcefor..."
Response.End
Else
WiththeHTTP_REFERER,theentireURLispassedalong...we
needtohackoutthehttp://www.4guysfromrolla.compart
strReferrer=Right(strReferrer,len(strReferrer)-7)
strReferrer=Right(strReferrer,len(strReferrer)-_
instr(1,strReferrer,"/")+1)
EndIf
EndIf
MakesuretheuserisnttryingtoviewASPsource
IfInStr(1,UCase(strReferrer),"/WEBTECH/")=0OR_
InStr(1,strReferrer,"..")0then
Shameonyou,tryingtoviewapageyourenotsupposeto...
Response.Write"Onlypagesinthe/webtech/"&_
"directorymaybeviewedinprinter-friendlyformat..."
Response.End
EndIf
SetobjFSO=Server.CreateObject("Scripting.FileSystemObject")
SetobjOpenFile=objFSO.OpenTextFile(Server.MapPath(strReferrer),_
ForReading)
Thereisalineineacharticle,
<%strPageTitle="ArticleNametodisplayinTITLETag"%>
Theresnoneedtospitthisout...
DoUntilobjOpenFile.AtEndOfStream
strLine=objOpenFile.ReadLine
IfInStr(1,strLine,"<%strPageTitle=")=0then
Response.WritestrLine&vbCrLf
EndIf
Loop
objOpenFile.Close
SetobjOpenFile=Nothing
SetobjFSO=Nothing
%>
<P><HR><P><CENTER><FONTSIZE=2><I>
Thisarticlewasbroughttoyouby4GuysFromRolla.com!WhenyouthinkASP,
think4GuysFromRolla.com!<BR>
http://www.4GuysFromRolla.com</FONT></I></CENTER><P>
</BODY>
</HTML>
好好享用!
</p>我想详细了解ASP整站代码与PSP整站代码有什么优缺点,那个更好,更安全,更用容易维护,和管理。。。 |
|