日期:2014-05-16  浏览次数:20318 次

高手帮忙写下asp涵数啊!先谢谢了!
function   aa()

end   function

如 
  bb= "/up/img/1.gif "
 
我想要的结果是
  aa(bb)
    它的结果是 /up/img/lysanhu1.gif
请高用帮我写出function里面的啊!!
就是如何把 lysanhu   加上去!!
谢谢了


------解决方案--------------------
function aa(bb)
aa=bb;
end function
调用的时候:

bb= "/up/img/1.gif "

call aa(bb)
------解决方案--------------------
function aa(bb,str)
aa=left(bb,instrrev(bb, "/ "))&str&right(bb,len(bb)-instrrev(bb, "/ "))
end function

response.write aa( "/up/img/1.gif ", "lysanhu ")
------解决方案--------------------
有点像批量改名。
二楼正解!

asp与vbscript相通。我作一个vbscript本地页面测试通过:

========以下代码============

<html>
<head>
<title> 批量替换测试 </title>
</head>

<body>

<script language= "vbscript ">
function aa(bb,str)
aa=left(bb,instrrev(bb, "/ ")) & str & right(bb,len(bb) - instrrev(bb, "/ "))
end function

document.write(aa( "/up/img/1.gif ", "lysanhu "))
document.write( " <p> ")

document.write(aa( "/up/img/23.gif ", "lysanhu "))
document.write( " <p> ")

document.write(aa( "/up/img/4_6.gif ", "lysanhu "))
document.write( " <p> ")

document.write(aa( "/up/img/7%208.gif ", "lysanhu "))
document.write( " <p> ")


</script>
</body>
</html>