ASP控制标题字数
<%SetRs=Conn.Execute("Selecttop5*FromNewsWhereClass='001'OrderByDateTimeDesc")%><%IFN...
<% Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc") %>
<% IF Not (Rs.EOF AND Rs.BOF) Then %>
<% While not rs.eof %>
<% Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&rs("Title")&"</font></a><br>"%>
<% Rs.MoveNext %>
<% Wend %>
<% End IF %>
<% Rs.Close %>
<% Set Rs = Nothing %>
哪位教师帮忙整一下! 展开
<% IF Not (Rs.EOF AND Rs.BOF) Then %>
<% While not rs.eof %>
<% Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&rs("Title")&"</font></a><br>"%>
<% Rs.MoveNext %>
<% Wend %>
<% End IF %>
<% Rs.Close %>
<% Set Rs = Nothing %>
哪位教师帮忙整一下! 展开
3个回答
展开全部
<%
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
Do While not rs.eof
Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&Left(rs("Title"),6)&"</font></a><br>"
Rs.MoveNext
loop
End IF
Rs.Close
Set Rs = Nothing
%>
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
Do While not rs.eof
Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&Left(rs("Title"),6)&"</font></a><br>"
Rs.MoveNext
loop
End IF
Rs.Close
Set Rs = Nothing
%>
七鑫易维信息技术
2024-09-02 广告
2024-09-02 广告
Play Video 七鑫易维是致力于机器视觉和人工智能领域的高新科技企业,迄今已专注眼球追踪技术的研发、创新与应用超过14年,拥有完全自主知识产权,全球专利总量655余项。 作为眼球追踪技术领域的全球知名品牌,七鑫易维的产品体系覆盖眼动分...
点击进入详情页
本回答由七鑫易维信息技术提供
展开全部
<%
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
While not rs.eof
%>
<img src=images/jt.gif> <a href="News.asp?ID=<%=Rs("ID")%>"><font color=#FFCC00><%=rs("Title")%></font></a><br>
<%
Rs.MoveNext
Wend
End IF
Rs.Close
Set Rs = Nothing
%>
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
While not rs.eof
%>
<img src=images/jt.gif> <a href="News.asp?ID=<%=Rs("ID")%>"><font color=#FFCC00><%=rs("Title")%></font></a><br>
<%
Rs.MoveNext
Wend
End IF
Rs.Close
Set Rs = Nothing
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
' ============================================
' 获取字符实际长度
' ============================================
Function GetTrueLen(str)
If IsNull(str) Or str = "" Then
GetTrueLen = 0
Else
Dim i, n, k, chrA
k = 0
n = Len(str)
For i = 1 To n
chrA = Mid(str, i, 1)
If Asc(chrA) >= 0 And Asc(chrA) <= 255 Then
k = k + 1
Else
k = k + 2
End If
Next
GetTrueLen = k
End If
End Function
' ============================================
'截取显示字符串
' ============================================
Public Function CutStr(Str,LenNum)
Dim P_Num
Dim i, X
If GetTrueLen(Str) <= LenNum Then
CutStr = Str
Else
P_Num = 0
X = 0
Do While Not P_Num > LenNum - 2
X = X + 1
If Asc(Mid(Str, X, 1)) < 0 Then
P_Num = Int(P_Num) + 2
Else
P_Num = Int(P_Num) + 1
End If
CutStr = Left(Trim(Str), X) & "..."
Loop
End If
End Function
' 获取字符实际长度
' ============================================
Function GetTrueLen(str)
If IsNull(str) Or str = "" Then
GetTrueLen = 0
Else
Dim i, n, k, chrA
k = 0
n = Len(str)
For i = 1 To n
chrA = Mid(str, i, 1)
If Asc(chrA) >= 0 And Asc(chrA) <= 255 Then
k = k + 1
Else
k = k + 2
End If
Next
GetTrueLen = k
End If
End Function
' ============================================
'截取显示字符串
' ============================================
Public Function CutStr(Str,LenNum)
Dim P_Num
Dim i, X
If GetTrueLen(Str) <= LenNum Then
CutStr = Str
Else
P_Num = 0
X = 0
Do While Not P_Num > LenNum - 2
X = X + 1
If Asc(Mid(Str, X, 1)) < 0 Then
P_Num = Int(P_Num) + 2
Else
P_Num = Int(P_Num) + 1
End If
CutStr = Left(Trim(Str), X) & "..."
Loop
End If
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询