CreateKeyWord asp实现的由给定的字符串生成关键字的代码_应用技巧

'**************************************************
'函数名:CreateKeyWord
'作  用:由给定的字符串生成关键字
'参  数:Constr---要生成关键字的原字符串
'返回值:生成的关键字
'**************************************************
Function CreateKeyWord(byval Constr,Num)
   If Constr="" or IsNull(Constr)=True or Constr="$False$" Then
      CreateKeyWord="$False$"
      Exit Function
   End If
   If Num="" or IsNumeric(Num)=False Then
      Num=2
   End If
   Constr=Replace(Constr,CHR(32),"")
   Constr=Replace(Constr,CHR(9),"")
   Constr=Replace(Constr," ","")
   Constr=Replace(Constr," ","")
   Constr=Replace(Constr,"(","")
   Constr=Replace(Constr,")","")
   Constr=Replace(Constr,"<","")
   Constr=Replace(Constr,">","")
   Constr=Replace(Constr,"""","")
   Constr=Replace(Constr,"?","")
   Constr=Replace(Constr,"*","")
   Constr=Replace(Constr,"|","")
   Constr=Replace(Constr,",","")
   Constr=Replace(Constr,".","")
   Constr=Replace(Constr,"/","")
   Constr=Replace(Constr,"\","")
   Constr=Replace(Constr,"-","")
   Constr=Replace(Constr,"@","")
   Constr=Replace(Constr,"#","")
   Constr=Replace(Constr,"$","")
   Constr=Replace(Constr,"%","")
   Constr=Replace(Constr,"&","")
   Constr=Replace(Constr,"+","")
   Constr=Replace(Constr,":","")
   Constr=Replace(Constr,":","")   
   Constr=Replace(Constr,"‘","")
   Constr=Replace(Constr,"“","")
   Constr=Replace(Constr,"”","")
   Constr=Replace(Constr,"&","")  
   Constr=Replace(Constr,"gt;","")      
   Dim i,ConstrTemp
   For i=1 To Len(Constr)
      ConstrTemp=ConstrTemp & "|" & Mid(Constr,i,Num)
   Next
   If Len(ConstrTemp)<254 Then
      ConstrTemp=ConstrTemp & "|"
   Else
      ConstrTemp=Left(ConstrTemp,254) & "|"
   End If
   ConstrTemp=left(ConstrTemp,len(ConstrTemp)-1)
   ConstrTemp= Right(ConstrTemp,len(ConstrTemp)-1)
   CreateKeyWord=ConstrTemp
End Function

时间: 2024-08-01 17:32:35

CreateKeyWord asp实现的由给定的字符串生成关键字的代码_应用技巧的相关文章

CreateKeyWord asp实现的由给定的字符串生成关键字的代码

'************************************************** '函数名:CreateKeyWord '作  用:由给定的字符串生成关键字 '参  数:Constr---要生成关键字的原字符串 '返回值:生成的关键字 '************************************************** Function CreateKeyWord(byval Constr,Num)    If Constr="" or IsNu

asp下根据标题生成关键字的代码_应用技巧

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

由给定的字符串生成关键字_应用技巧

'函数名:CreateKeyWord '作  用:由给定的字符串生成关键字 '参  数:Constr---要生成关键字的原字符串 '返回值:生成的关键字 '************************************************** Function CreateKeyWord(byval Constr,Num)    If Constr="" or IsNull(Constr)=True or Constr="$False$" Then  

由给定的字符串生成关键字

'函数名:CreateKeyWord '作  用:由给定的字符串生成关键字 '参  数:Constr---要生成关键字的原字符串 '返回值:生成的关键字 '************************************************** Function CreateKeyWord(byval Constr,Num)    If Constr="" or IsNull(Constr)=True or Constr="$False$" Then  

asp.net TreeView递归循环子节点生成树形菜单实例_实用技巧

本文实例讲述了asp.net TreeView递归循环子节点生成树形菜单的方法.分享给大家供大家参考,具体如下: 这里主要用到递归循环获取子结点 /// <summary> /// 生成根节点 /// </summary> /// <param name="treeview"></param> protected void BindTreeView(long ID, TreeView treeview) { DataTable dt =

ASP.Net中英文复合检索文本框实现思路及代码_实用技巧

前段时间,写一个用户部门的管理页面,需要对后台获取的用户数据实现英汉检索功能. 同时,选定一个选项之后,需要触发事件与后台交互,将该用户所在的部门显示到页面右边的ListBox控件中.       一.Dojo的FilteringSelect组件实现拼音检索功能 在网上有不少相关的介绍,其中比较经典的有"海盗乱语"的关于重写Dojo的FilteringSelect组件实现拼音检索功能的介绍(地址http://cosbor.web-144.com/?p=38.http://cosbor.

使用ASP.NET一般处理程序或WebService返回JSON的实现代码_实用技巧

示例代码下载: http://zsharedcode.googlecode.com/files/JQueryElementDemo.rar 本文中所包含的内容如下:   * 准备  * 一般处理程序/ashx  * WebService/asmx准备 如果希望通过 ashx 或者 asmx 来返回 JSON, 那么需要引用程序集 System.Web.Extensions.dll, 在 .NET 3.5, 4.0 中已经默认包含. 对于 .NET 2.0, 3.0, 需要安装 ASP.NET 2

asp 由动态网页转变为静态网页的实现代码_应用技巧

具体代码实现: 1.模板文件(html) 复制代码 代码如下: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>{title} - 新闻中心 - 哎呀呀饰品加盟连锁</title>

Asp.net利用JQuery弹出层加载数据代码_实用技巧

首先我们新建一个网站,在网站里面新增一般处理程序,命名为ReadData.ashx.然后在里面输入如下代码: 复制代码 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Data.SqlClient; //引入命名空间 using System.Data; namespace 加载层 {