看不懂的asp网站代码?

来源:百度知道 编辑:UC知道 时间:2024/05/17 11:14:44
下面是一个format.asp文件的代码,不懂有什么用?看不懂什么意思?哪位好心人帮我看看.先谢谢了!~~~~~~~
<%
function cutstr(str,strlen,more,url)
if len(str)>strlen then
str=left(str,strlen) & "......"
end if
if (len(str)>strlen) and more then
str=str+"   [url="+url+"]点这里查看详情[/url]"
end if
cutstr=str
end function

function strLength(str)
ON ERROR RESUME NEXT
dim WINNT_CHINESE
WINNT_CHINESE = (len("论坛")=2)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strLength=t
else
strLength=len(str)
end if
if err.number<>

function cutstr(str,strlen,more,url) '自定义CUTSTR开始
if len(str)>strlen then ‘如果str的长度 大于 strlen 那么
str=left(str,strlen) & "......" 'str=取str左边strlen位
end if
if (len(str)>strlen) and more then
str=str+" [url="+url+"]点这里查看详情[/url]"
end if
cutstr=str
end function '自定义的cutstr结束

以上大多用在标题显示上面
如标题:以上大多用在标题显示上面
我只要标题的前四位多的话就用“以上大多...”
那么 cutstr("以上大多用在标题显示上面",4,more,"http://这个标题联接的网址")

我只是说下意思

主要定义了两个按钮,和连接的相关网址