⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.asp

📁 网络管理,可用于网站建设
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="md5.asp" -->
<!-- #include file="constant.asp" -->
<%
response.Expires=-999
Session.Timeout=200
'---------------------
'定义常量
'---------------------
set rs=server.createobject("adodb.recordset")
set rst=server.createobject("adodb.recordset")
'---------------------
'错误显示信息函数
'---------------------
Function ShowErr(ErrStr,Going)
  call pagend()
  if Going="1" then
    Response.Write "<Script>alert('"& ErrStr &"');location.href='javascript:history.go(-1)';</Script>"
  else
    Response.Write "<Script>alert('"& ErrStr &"');location.href='"& Going &"';</Script>"
  end if
  Response.End()
End Function
'---------------------
'结束对象函数
'---------------------
Function pagend()
  set rs=nothing
  conn.close
  set conn=nothing
End Function

'---------------------
'字符转换函数
'---------------------
Function HTMLEncode(fString)
  If Not IsNull(fString) Then
	fString = replace(fString, ">", "&gt;")
	fString = replace(fString, "<", "&lt;")
	fString = Replace(fString, CHR(32), " ")		
	fString = Replace(fString, CHR(34), "&quot;")
	fString = Replace(fString, CHR(39), "&#39;")
	fString = Replace(fString, CHR(9), "&nbsp;")
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
	fString = Replace(fString, CHR(10), "<BR> ")
	HTMLEncode = fString
  End If
End Function

'---------------------
'字符转回函数
'---------------------
function HTMLDncode(fString)
  If Not IsNull(fString) Then
    fString = Replace(fString, "&gt;",">" )
    fString = Replace(fString, "&lt;", "<")
    fString = Replace(fString, " ", CHR(32))
    fString = Replace(fString, "&nbsp;", CHR(9))
    fString = Replace(fString, "&quot;", CHR(34))
    fString = Replace(fString, "&#39;", CHR(39))
    fString = Replace(fString, "", CHR(13))
    fString = Replace(fString, "</P><P> ",CHR(10) & CHR(10) )
    fString = Replace(fString, "<BR> ",CHR(10) )
    HTMLDncode = fString
  End If
End Function 

'---------------------
'截取字符函数
'---------------------
Function Jiequ(fString,fNum)
  if len(fString)>cint(fNum) then
    Jiequ=left(fString,cint(fNum)) & "..."
  else
    Jiequ=fString
  end if
End Function

'---------------------
'判断字符串长度
'---------------------
Function CheckStringLength(txt)
txt=trim(txt)
x = len(txt)
y = 0
for ii = 1 to x
  if asc(mid(txt,ii,1))<0 or asc(mid(txt,ii,1))>255 then
    y = y + 2
  else
    y = y + 1
  end if
next
CheckStringLength = y
End Function

'---------------------
'判断是否数字
'---------------------
Function CheckNum(checkstr)
  if not isnumeric(checkstr) or checkstr="" then
    call ShowErr("参数错误","1")
  end if
End Function

'---------------------
'公交车费用查询
'---------------------
Function SearchRate1(BusStr)
  sqlstr="select * from [Bus] where qmbus_name='"& BusStr &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
	  bus_rate=rs("qmbus_rate")
	  bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错!")
	  response.End()
	end if
  rs.close
  response.Write("<span style='font-size:12px;padding-left:20px; padding-top:0px;'>单程票价:"&bus_rate&"</span><br><span style='font-size:12px;padding-left:20px; padding-top:0px;'>相关说明:"&bus_ratebz&"</span><hr style='height:1px; color:#B4CBDD;'>")
End Function

Function SearchRate2(BusInfo1,BusInfo2)
  sqlstr="select * from [Bus] where qmbus_name='"& BusInfo1 &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
		bus_rate=rs("qmbus_rate")
		 bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错!")
	  response.End()
	end if
  rs.close
  BusString1="(<font color='#FF8000'>"&BusInfo1&"路</font>:&nbsp;"&bus_rate&"&nbsp;&nbsp;"
  Busratebz1="<font color='#FF8000'>"&BusInfo1&"路</font>:&nbsp;"&bus_ratebz&"&nbsp;&nbsp;"
  
  sqlstr="select * from [Bus] where qmbus_name='"& BusInfo2 &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
		bus_rate=rs("qmbus_rate")
		 bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错!")
	  response.End()
	end if
  rs.close
  BusString2="<font color='#FF8000'>"&BusInfo2&"路</font>:&nbsp;"&bus_rate&")<br>"
  Busratebz2="<font color='#FF8000'>"&BusInfo2&"路</font>:&nbsp;"&bus_ratebz&"<hr style='height:1px; color:#B4CBDD;'>"
  response.Write("<span style='font-size:12px;padding-left:20px; padding-top:0px;'>单程票价:"&BusString1&BusString2)
  response.Write("</span>")
  response.Write("<span style='font-size:12px;padding-left:20px; padding-top:0px;'>相关说明:"&Busratebz1&Busratebz2)
    response.Write("</span>")
End Function

Function SearchRate3(InfoBus1,InfoBus2,InfoBus3)
  sqlstr="select * from [Bus] where qmbus_name='"& InfoBus1 &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
		bus_rate=rs("qmbus_rate")
		bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错q!")
	  response.End()
	end if
  rs.close
  InfoString1="(<font color='#FF8000'>"&InfoBus1&"路</font>:&nbsp;"&bus_rate&"&nbsp;&nbsp;"
  Busratebz1="<font color='#FF8000'>"&InfoBus1&"路</font>:&nbsp;"&bus_ratebz&"&nbsp;&nbsp;"
  
  sqlstr="select * from [Bus] where qmbus_name='"& InfoBus2 &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
		bus_rate=rs("qmbus_rate")
		bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错w!")
	  response.End()
	end if
  rs.close
  InfoString2="<font color='#FF8000'>"&InfoBus2&"路</font>:&nbsp;"&bus_rate&"&nbsp;&nbsp;"
  Busratebz2="<font color='#FF8000'>"&InfoBus2&"路</font>:&nbsp;"&bus_ratebz&"&nbsp;&nbsp;"
  
  sqlstr="select * from [Bus] where qmbus_name='"& InfoBus3 &"'"
  rs.open sqlstr,conn,1,3
    if not rs.eof then
		bus_rate=rs("qmbus_rate")
		bus_ratebz=rs("qmbus_ratebz")
	else
	  response.Write("数据库数据出错e!")
	  response.End()
	end if
  rs.close
  InfoString3="<font color='#FF8000'>"&InfoBus3&"路</font>:&nbsp;"&bus_rate&")<br>"
  Busratebz3="<font color='#FF8000'>"&InfoBus3&"路</font>:&nbsp;"&bus_ratebz&"<hr style='height:1px; color:#B4CBDD;'>"
  response.Write("<span style='font-size:12px;padding-left:20px; padding-top:0px;'>单程票价:"&InfoString1&InfoString2&InfoString3)
  response.Write("</span>")
  response.Write("<span style='font-size:12px;padding-left:20px; padding-top:0px;'>相关说明:"&Busratebz1&Busratebz2&Busratebz3)
  response.Write("</span>")
End Function

'---------------------
'其他本系统常用的数据
'---------------------
Function RouteErr(RouteStr)
  response.Write("<hr style='height:1px; color:#B4CBDD;'>&nbsp;&nbsp;&nbsp;&nbsp;对不起,未找到与<span style='color:#FF0000'><strong>")
  response.Write(RouteStr)
  response.Write("路公交车</strong></span>相关的公交线路信息<br>&nbsp;&nbsp;&nbsp;&nbsp;主要原因如下:")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;您输入的公交线路有误!请重新输入正确的公交线路进行查询</li>")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;本站里没有该线路的详细资料,如果您确信本站数据有误的话请")
  response.Write("<a href='writemsg.asp'><font color=#FF0000>给我留言</font></a>(公交数据需要大家共同维护)</li><hr style='height:1px; color:#B4CBDD;'>")
End Function

Function StatioinErr(StationStr)
  response.Write("<hr style='height:1px; color:#B4CBDD;'>&nbsp;&nbsp;&nbsp;&nbsp;对不起,未找到与<span style='color:#FF0000'><strong>")
  response.Write(StationStr)
  response.Write("</strong></span>相关的公交站点信息<br>&nbsp;&nbsp;&nbsp;&nbsp;主要原因如下:")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;您输入的公交站点有误!请重新输入正确的公交站点进行查询</li>")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;本站里没有该站点的详细资料,如果您确信本站数据有误的话请")
  response.Write("<a href='writemsg.asp'><font color=#FF0000>给我留言</font></a>(公交数据需要大家共同维护)</li><hr style='height:1px; color:#B4CBDD;'>")
End Function

Function Suggestion(info_name,info_date)
  response.Write("<span style='font-size:12px'>如果您发现与<font color='#FF0000'><strong>深圳"&info_name&"路车</strong></font>有出入的地方,请<a href='writemsg.asp' target=_blank><font color=#26F709><strong>给我留言</strong></font></a>,公交数据需要大家共同维护 最后更新日期为:"&info_date&"</span>")
  response.Write("<hr style='height:1px; color:#B4CBDD'>")
End Function

Function NonSearch(info_1,info_2)
  response.Write("<hr style='height:1px; color:#B4CBDD;'>&nbsp;&nbsp;&nbsp;&nbsp;对不起,未找到<font color=#FF0000><strong>")
  response.Write(info_1&"</strong></font>到<font color=#FF0000><strong>"&info_2&"</strong></font>的具体乘车方案")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;您输入的公交站点有误!请重新输入正确的公交站点进行站查询</li>")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;您要查的公交站点可能需要三次或三次以上的换乘才能够到达,本站最多只支持查询二次换乘!")
  response.Write("<li>&nbsp;&nbsp;&nbsp;&nbsp;本站里没有该站点的详细资料,如果您确信本站数据有误的话请")
  response.Write("<a href='writemsg.asp'>给我留言</a> (公交数据需要大家共同维护)</li><hr style='height:1px; color:#B4CBDD;'>")
End Function
%>

⌨️ 快捷键说明

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