asp replace问题
<%html="<ahref=""http://192.168.1.103/xxx/Show.asp?id=1""target=""_blank""><strong>te...
<%
html = "<a href=""http://192.168.1.103/xxx/Show.asp?id=1""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=2""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=22""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=49""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=12""
target=""_blank""><strong>test1</strong></a><br />"
for i = 1 to 50
Addr = "Show.asp?id="&i&""
theE = Right(Addr,Len(Addr)-InStr(Addr,"="))
theLink = "hTml/"&theE&".hTml"
hTml = Replace(hTml,Addr,theLink)
next
response.Write(html)
%>
很简单的一段代码
功能:把Show.asp?id=《id》转换成 hTml/《id》.hTml
当id为个位数时正常,但是id为2位数以上的时候就会变成这样
Show.asp?id49 ====>>
hTml/4.hTml9
百思不得其解?? 展开
html = "<a href=""http://192.168.1.103/xxx/Show.asp?id=1""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=2""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=22""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=49""
target=""_blank""><strong>test1</strong></a><br /><a
href=""http://192.168.1.103/xxx/Show.asp?id=12""
target=""_blank""><strong>test1</strong></a><br />"
for i = 1 to 50
Addr = "Show.asp?id="&i&""
theE = Right(Addr,Len(Addr)-InStr(Addr,"="))
theLink = "hTml/"&theE&".hTml"
hTml = Replace(hTml,Addr,theLink)
next
response.Write(html)
%>
很简单的一段代码
功能:把Show.asp?id=《id》转换成 hTml/《id》.hTml
当id为个位数时正常,但是id为2位数以上的时候就会变成这样
Show.asp?id49 ====>>
hTml/4.hTml9
百思不得其解?? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询