📄 function.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
</html>
<%
'--------------------------------------------------------------------
'函数名:NavNews()
'作 用:返回信息导航
'--------------------------------------------------------------------
function NavNews()
set rs=conn.execute("SelectTable 'NewsClass2','NewsClass2ID="&Request.QueryString("NewsClass2ID")&"'")
if rs("NewsClass1ID")=1 then
NavNews="您现在的位置:<a href=""/"" class=""a8"">首页</a> >> <a href=""NavNews.asp"" class=""a8"">信息导航</a> >> <a href=""#"" class=""a8"">"&rs("NewsClass2Name")&"</a>"
end if
if rs("NewsClass1ID")=2 then
NavNews="您现在的位置:<a href=""/"" class=""a8"">首页</a> >> <a href=""NavApp.asp?NewsClass1ID=2"" class=""a8"">美观应用</a> >> <a href=""#"" class=""a8"">"&rs("NewsClass2Name")&"</a>"
end if
if rs("NewsClass1ID")=3 then
NavNews="您现在的位置:<a href=""/"" class=""a8"">首页</a> >> <a href=""NavApp.asp?NewsClass1ID=3"" class=""a8"">功能应用</a> >> <a href=""#"" class=""a8"">"&rs("NewsClass2Name")&"</a>"
end if
if rs("NewsClass1ID")=4 then
NavNews="您现在的位置:<a href=""/"" class=""a8"">首页</a> >> <a href=""NavTra.asp"" class=""a8"">交易导航</a> >> <a href=""#"" class=""a8"">"&rs("NewsClass2Name")&"</a>"
end if
RsClose()
end function
'--------------------------------------------------------------------
'函数名:ShowTitle()
'作 用:返回网页标题
'--------------------------------------------------------------------
function ShowTitle()
ShowTitle="全息导航--全球首家全息行业网站,研发、市场、企业之间交流与合作的平台"
end function
'--------------------------------------------------------------------
'函数名:SubmitOK()
'作 用:返回提交成功
'--------------------------------------------------------------------
function SubmitOK()
Response.Write ("<script>alert('提交成功!');history.go(-1);</script>")
end function
'--------------------------------------------------------------------
'函数名:CutStr()
'作 用:截取字符串
'--------------------------------------------------------------------
function CutStr(str,num)
if len(str)>num then str=left(str,num-2)&"..."
CutStr=str
end function
'--------------------------------------------------------------------
'函数名:ShowAdvT(ClassID)
'作 用:显示通栏广告位
'--------------------------------------------------------------------
function ShowAdvT(ClassID,WNum,HNum)
Response.Write"<table width=""890"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
Response.Write"<tr height=""2""><td></td></tr>"
Response.Write"<tr><td background=""images/top-gd-bj.gif"">"
set rs=conn.execute("select PicName,AdvLink,AdvType from Adv where ClassID="&ClassID&" and EndDate>='"&date()&"'" )
do while not rs.eof
if rs("AdvType")=1 then
response.write"<img src=""/UploadFile/"&rs("PicName")&""" width="&WNum&" height="&HNum&">"
else
Response.Write"<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"" style=""width: 890px; height: 105px"">"
Response.Write"<param name=""movie"" value=""/UploadFile/"&rs("PicName")&""" >"
Response.Write"<param name=""quality"" value=""Medium"">"
Response.Write"<embed src=""/UploadFile/"&rs("PicName")&""" quality=""Medium"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" style=""width: 890px; height: 105px""></embed>"
Response.Write"</object>"
end if
rs.movenext
loop
RsClose()
Response.Write"</td></tr><tr height=""2""><td></td></tr></table>"
end function
'--------------------------------------------------------------------
'函数名:ShowAdvH(ClassID)
'作 用:竖排广告位
'--------------------------------------------------------------------
function ShowAdvH(ClassID)
set rs=conn.execute("select PicName,AdvLink from Adv where ClassID="&ClassID&" and EndDate>='"&date()&"'" )
do while not rs.eof
if right(rs("PicName"),3)="swf" then
Response.Write"<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"" style=""width: 890px; height: 105px"">"
Response.Write"<param name=""movie"" value=""/UploadFile/"&rs("PicName")&""" >"
Response.Write"<param name=""quality"" value=""Medium"">"
Response.Write"<embed src=""/UploadFile/"&rs("PicName")&""" quality=""Medium"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" style=""width: 890px; height: 105px""></embed>"
Response.Write"</object>"
else
response.write"<br><a href="""&rs("AdvLink")&""" target=""_blank""><img src=""/UploadFile/"&rs("PicName")&""" border=""0""></a><br>"
end if
rs.movenext
loop
RsClose()
end function
'--------------------------------------------------------------------
'函数名:ShowAdvO(ClassID)
'作 用:单个广告位
'--------------------------------------------------------------------
function ShowAdvO(ClassID,WNum,HNum)
set rs1=conn.execute("select PicName,AdvLink from Adv where ClassID="&ClassID&" and EndDate>='"&date()&"' order by AdvID Desc ")
response.write"<a href="""&rs1("AdvLink")&""" target=""_blank""><img src=""/UploadFile/"&rs1("PicName")&""" border=""0"" width="&WNum&" height="&HNum&"></a>"
rs1.Close
set rs1=nothing
end function
'---------------------------------------------------------------------
'函数名:makePassword(byVal maxLen)
'作 用:随机产生密码
'---------------------------------------------------------------------
function makePassword(byVal maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
'character
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
makePassword = strNewPass
end function
'-----------------------------------------------------------------------
'函数名:coder(str)
'作 用: 文本框空格换行替换函数
'-----------------------------------------------------------------------
Function coder(str)
Dim result,L,i
If IsNull(str) Then : coder="" : Exit Function : End If
L=Len(str) : result=""
For i = 1 to L
select case mid(str,i,1)
case "<" : result=result+"<"
case ">" : result=result+">"
case chr(34) : result=result+"""
case "&" : result=result+"&"
case chr(13) : result=result+"<br>"
case chr(9) : result=result+" "
case chr(32) : result=result+" "
case else : result=result+mid(str,i,1)
end select
Next
coder=result
End Function
'-----------------------------------------------------------------------
'函数名:ShowNewsOnlyContent(id)
'作 用:显示单页信息内容
'-----------------------------------------------------------------------
Function ShowNewsOnlyContent(id)
set rs=conn.execute("select * from NewsOnly where NewsID="&id)
Response.Write rs("NewsContent")
RsClose()
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -