gettown.asp

来自「ajax 通过省份名显示城市名称,这个源码经测试通过」· ASP 代码 · 共 27 行

ASP
27
字号
<%@LANGUAGE="VBSCRIPT.Encode" CODEPAGE="65001"%>
<!--#include file="Inc/conn.inc"-->
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"

cityId = CInt(request("cityId"))

set con=getConn()
set rs=getRs()

sql="select CityID, CityPostCode, CityName from ChinaCity where "
sql=sql&" Left(CityPostCode, 4)='"&cityId&"' and Right(CityPostCode, 2) <> '00' order by [CityID]"
rs.open sql,con,1,1
			
while not rs.bof and not rs.eof
	outStr=outstr & rs("CityPostCode")&"-"&rs("CityName") & ","
	rs.movenext
wend
			
rs.close
con.close

outStr=left(outStr, len(outStr)-1)	'remove the last ','
response.Write(outStr)
%>

⌨️ 快捷键说明

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