优秀的软件开发团队:深圳升蓝软件 数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类     
热门推荐
升蓝OA办公自动化系统
基于.Net技术的网络
协同办公环境
 
ASP基础
数据库相关
安全加密
全文检索
ASP应用
打印相关
客户端相关
XML相关
系统相关
正则表达式
ASP技巧
组件开发
脚本编码
FSO专题
邮件相关
远程脚本
性能优化
 
相关链接
深圳升蓝软件:系统集成、办公自动化平台、电子商务、电子政务、Web数据库、企业网站、游戏、手机应用程序、CDMA软件、电子出版物等,为客户提供优秀的解决方案
 
升蓝(www.hi-blue.com)为企业管理、政府办公提供成熟的、易于实施的IT技术服务,我们的解决方案包括OA办公自动化系统CRM客户关系管理系统ERP企业生产管理和订单管理系统电子政务系统、知识管理系统、企业门户、商业智能、工程项目管理等等...
 
电子政务解决方案
塑料/橡胶管理系统
知识管理系统简介
多媒体光盘方案
ERP企业资源管理
订单计划管理系统
PM工程项目管理系统
会员管理系统
相关资料下载
OA办公自动化系统
CRM客户关系管理系统
在线试用版本说明
OA 系统的用户手册
 
 
 
 
升蓝开发团队 > 技术资料 > ASP技术 > 客户端相关 : 转换字符串带有http://的超级链接字符串为真正的超级?/td>

转换字符串带有http://的超级链接字符串为真正的超级?/H1>
March 25,2004

//-----------searched by aspHouse http://aspage.yeah.net/ --------------//
//-----------from http://line9.com/tek9.asp?pg=freebies&specific=34-----//
Code Title: Auto-linking
Description: How would you like to have every instance of an http:// auto-hyperlink itself to the URL
address that follows it? Well, here is a killer little function that will take every one of those that it
finds in a string and sets up the hyperlink for you! Cool, eh?
Copy and paste this snippet as-is into your editor:

-------------------------------------------------------------------------
<%
Function LinkURLs(strInput)
iCurrentLocation = 1
Do While InStr(iCurrentLocation, strInput, "http://", 1) <> 0
iLinkStart = InStr(iCurrentLocation, strInput, "http://", 1)
iLinkEnd = InStr(iLinkStart, strInput, " ", 1)
If iLinkEnd = 0 Then iLinkEnd = Len(strInput) + 1
Select Case Mid(strInput, iLinkEnd - 1, 1)
Case ".", "!", "?"
iLinkEnd = iLinkEnd - 1
End Select
strOutput = strOutput & Mid(strInput, iCurrentLocation, iLinkStart - iCurrentLocation)
strLinkText = Mid(strInput, iLinkStart, iLinkEnd - iLinkStart)
strOutput = strOutput & "<a href="""&strLinkText&""">"&strLinkText&"</a>"
iCurrentLocation = iLinkEnd
Loop
strOutput = strOutput & Mid(strInput, iCurrentLocation)
LinkURLs = strOutput
End Function
strUnlinked = "http://LINE9.com rules! <br>" & vbCrLf
strUnlinked = strUnlinked & "http://pdxpc.com sells great computers!<br>" & vbCrLf

' Here is the before text:
Response.Write "<b>Original Text:</b><br>" & vbCrLf
Response.Write strUnlinked
Response.Write vbCrLf & "<br>" & vbCrLf & vbCrLf

' Here is the text after it gets automatically hyperlinked to itself:
Response.Write "<b>Text After Linking:</b><br>" & vbCrLf
Response.Write LinkURLs(strUnlinked)
%>
-------------------------------------------------------------------------

数据库开发 | .Net技术 | ASP技术 | PHP技术 | JSP技术 | 应用技术类 | 升蓝开发小组
Copyright ? 2001-2004 Shenzhen Hi-blue Software Team 升蓝开发小组 All rights reserved