ASP网址和邮件地址的转换函数

函数|转换

<%
  function URLconvert(str)
  convertstr=str
  urlLocation=instr(convertstr,"http://")
  if (urlLocation=0) and (mailLocation=0) then
  URLconvert=convertstr
  exit function
  end if
  if urlLocation<>0 then
  rightstr=str
  Do while urlLocation<>urlLocationend
  urlLocation=instr(rightstr,"http://")
  urlLocationend=InStrRev(rightstr,"http://")
  finalstr=finalstr&left(rightstr,urlLocation-1)
  midurlstr=mid(rightstr,urlLocation+1,1)
  do while (asc(midurlstr)>=45) and (asc(midurlstr)<=126)
  loopint=loopint+1
  midurlstr=mid(rightstr,urlLocation+loopint,1)
  if midurlstr="" then exit do
  loop
  endURLstr=mid(rightstr,urllocation,loopint)
  URLstr="<a href="&endURLstr&">"&endURLstr&"</a>"
  rightstr=mid(rightstr,urllocation+loopint)
  finalstr=finalstr&URLstr
  loopint=1
  Loop
  end if
  finalstr=finalstr&rightstr
  convertstr1=finalstr
  finalstr=""
  mailLocation=instr(convertstr1,"@")
  if mailLocation<>0 then
  Do while mailLocation<>mailLocationend
  mailLocation=instr(convertstr1,"@")
  mailLocationend=InStrRev(convertstr1,"@")
  mainmidmailstr=mid(convertstr1,mailLocation+1,1)
  midmailstr=mainmidmailstr
  do while (asc(midmailstr)>=45) and (asc(midmailstr)<=126)
  loopint1=loopint1+1
  midmailstr=mid(convertstr1,mailLocation-loopint1,1)
  loop
  firstSTR=mid(convertstr1,mailLocation-loopint1+1,loopint1-1)
  finalstr=finalstr&left(convertstr1,mailLocation-loopint1)
  midmailstr1=mainmidmailstr
  do while (asc(midmailstr1)>=45) and (asc(midmailstr1)<=126)
  loopint2=loopint2+1
  midmailstr1=mid(convertstr1,mailLocation+loopint2,1)
  if midmailstr1="" then exit do
  loop
  secondSTR=mid(convertstr1,mailLocation,loopint2)
  endmailstr=firstSTR&secondSTR
  mailstr="<a href=mailto:"&endmailstr&">"&endmailstr&"</a>"
  finalstr=finalstr&mailstr
  convertstr1=mid(convertstr1,maillocation+loopint2)
  loopint1=1
  loopint2=1
  Loop
  end if
  finalstr=finalstr&convertstr1
  URLconvert=finalstr
  end function
  %>

时间: 2024-08-02 23:24:13

ASP网址和邮件地址的转换函数的相关文章

用asp实现网址和邮件地址的转换函数_应用技巧

网址和邮件地址的转换函数<% function URLconvert(str)  convertstr=str urlLocation=instr(convertstr,"http://") if (urlLocation=0) and (mailLocation=0) then  URLconvert=convertstr exit function end if if urlLocation<>0 then rightstr=str Do while urlLoc

用asp实现网址和邮件地址的转换函数

网址和邮件地址的转换函数 <% function URLconvert(str)  convertstr=str urlLocation=instr(convertstr,"http://") if (urlLocation=0) and (mailLocation=0) then  URLconvert=convertstr exit function end if if urlLocation<>0 then rightstr=str Do while urlLo

编程实现邮件地址有效性检测

编程 编者按:检测邮件地址的有效性可应用于防止垃圾邮件.用户非法注册等方面,本文将以编程的方式进行探讨,相信能给大家一些启示. 编程实现邮件地址有效性检测 文/brain 这个VB6COM组件提供了一项即时邮件查询的功能.它有效的避免了向一个不存在的账户发送邮件的情况.例如,在ASP页面里面检查用户输入的邮件地址是否正确,并避免在你的用户数据库里面存储相关的错误信息. 主要内容 工作原理 让我们首先来看一下这个组件是如何进行工作的. 首先给定一个E-mail地址(例如:someone@somew

ASP获取当前页面带参数的网址(URL地址)的方法

ASP获取当前页面带参数的网址(URL地址)的方法 以下是引用片段:'=========================================== '获取当前Url参数的函数 Function GetUrl()   Dim ScriptAddress,Servername,qs   ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))   Servername = CStr(Request.ServerVar

ASP读取网卡MAC地址函数代码

函数|mac|网卡 如何通过ASP读取网卡MAC地址呢?基本ASP平台来读取MAC地址需要两个系统关键的组件支持,"WSCRIPT.SHELL"和"Scripting.FileSystemObject"两个组件,不过,这两个组件的开放是相当危险的,因为很多的病毒脚本就是通过他们来控制主机权限的,在使用本功能时,要注意安全防范. 由于读取某IP的网卡MAC地址  本程序通过调用arp命令通过查询本机arp表读取特定IP的MAC地址  使用本程序需注意以下事项:   本

asp之转换函数示例

函数|示例|转换 asp之转换函数示例 Variant变量一般会将其代表的数据子类型自动转换成合适的数据类型,但有时候,自动转换也会造成一些数据类型不匹配的错误.这时,可使用转换函数来强制转换数据的子类型. 函数 功能 Asc 函数 返回与字符串的第一个字母对应的 ANSI 字符代码. Chr 函数 返回与指定的 ANSI 字符代码相对应的字符 Hex 函数 返回表示十六进制数字值的字符串. Oct 函数 返回表示数字八进制值的字符串. CStr 函数 返回表达式,该表达式已被转换为 字符串 子

1.socket编程:socket编程,网络字节序,函数介绍,IP地址转换函数,sockaddr数据结构,网络套接字函数,socket相关函数,TCP server和client

 1  Socket编程 socket这个词可以表示很多概念: 在TCP/IP协议中,"IP地址+TCP或UDP端口号"唯一标识网络通讯中的一个进程,"IP 地址+端口号"就称为socket. 在TCP协议中,建立连接的两个进程各自有一个socket来标识,那么这两个socket组成的socket pair就唯一标识一个连接.socket本身有"插座"的意思,因此用来描述网络连 接的一对一关系. TCP/IP协议最早在BSD UNIX上实现,

asp.net中如何实现点击邮件地址,就自动启动outlook程序,并且收件人地址自动写到outlook地址栏中?

问题描述 asp.net中如何实现点击邮件地址,就自动启动outlook程序,并且收件人地址自动写到outlook地址栏中?我看有很多地方都这样用.谢谢! 解决方案 解决方案二:不就是一个mailto的链接吗?PS:发贴即得30分,BS一下0分贴.解决方案三:ShellExecute(Me.Handle.ToInt32,"open","mailto:xxx@163.com&subject=124,Nothing,"C:",SW_SHOWNORMAL

js 检查密码验证函数与检查邮件地址代码

js 检查密码验证函数与检查邮件地址代码 //检查密码是否相同 function isSamePwd(objPwd1, objPwd2, msg) { pwd1 = objPwd1.value; pwd2 = objPwd2.value; if (pwd1 != pwd2) { if (null == msg) { alert("密码不相同!"); } else { alert(msg); } objPwd2.value = ""; objPwd2.focus();