util.asp

来自「用ASP写的电子购物系统」· ASP 代码 · 共 51 行

ASP
51
字号
<% REM ######################################################################### %>
<% REM                                                                           %>
<% REM   UTIL.ASP                                                                %>
<% REM   Microsoft Commerce Server v3.00                                         %>
<% REM                                                                           %>
<% REM   Copyright (c) 1996-98 Microsoft Corporation.  All rights reserved.      %>
<% REM                                                                           %>
<% REM ######################################################################### %>


<%
'处理文本中的回车符,换行符,制表符等,并转换为相应的HTML格式
function ConvertText(text)
	dim length,i,s,str
	
	length=len(text)
	str=""
	for i=1to length
		s=mid(text,i,1)
		select case s
			case VbCrLf  
				str=str & "<br>"
			case VbLf	
				str=str & "<br>"
			case " "	
				str=str & "&nbsp;"								
			case VbTab	
				str=str & "&nbsp;nbsp;nbsp;"
			case else
				str=str & s
		end select	
	next
	ConvertText=str
end function
%>

<%
'商品一级分类列表
function LevelOne()
	Response.Write"<option value=""all"" selected>所有商品</option>"
	cmdTemp.CommandText = "select * from product_level where parent_id=0 "
	Set rsDept = Server.CreateObject("ADODB.Recordset")
	rsDept.Open cmdTemp, , adOpenKeyset, adLockReadOnly
	If rsDept.RecordCount > 0 Then 
		While Not rsDept.EOF 
			Response.Write"<option value=" & Cstr(rsDept("level_id").Value) & ">" & rsDept("name").Value & "</option>"
			rsDept.MoveNext
		Wend
	End If
end function
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?