专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 其他开发语言

ASP,strContent ="" 怎么提取变量

发布时间:2011-06-30 07:28:27 文章来源:www.iduyao.cn 采编人员:星星草
ASP,strContent ="" 如何提取变量?
初来乍到,望大侠们帮帮忙!
原本我的ASP页面提取数据库变量是这样的:
<tr>
<td width="68%"><%=pro_name%></td>
</tr>

现在想要自动加链接,于是找到下面这段代码,可以将http地址自动加上链接。
但是,如何能将数据库的变量<%=pro_name%>提取到strContent =""的内容中呢?怎么写呢?


<% 
strContent ="厉害吧,这个地址会自动加链接 http://www.baidu.com" 
Set re=new RegExp 
re.IgnoreCase =true 
re.Global=True 
re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)" 
strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>") 
re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$" 
strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>") 
re.Pattern = "[^>=""](http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)" 
strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>") 
msgbox(strContent) 
%> 

另外,上面这段代码,如果要它识别没有带http的www要如何呢?如www.baidu.com


------解决方案--------------------
不太了解,帮你up
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: