由给定的字符串自动生成关键字
常见的用途:
1、根据文章的标题,生成本篇文章的关键字列表
2、根据文章的标题,生成本篇文章的关键字描述(稍微修改以下程序即可)
1、根据文章的标题,生成本篇文章的关键字列表
2、根据文章的标题,生成本篇文章的关键字描述(稍微修改以下程序即可)
'**************************************************
'函数名:CreateBaiduKeyWord
'作 用:由给定的字符串生成包含百度搜索的关键字链接
'参 数:Constr---要生成关键字的原字符串
'返回值:生成的关键字的链接
'**************************************************
Function CreateBaiduKeyWord(byval Constr,Num)
If Constr="" or IsNull(Constr)=True or Constr="" Then
CreateBaiduKeyWord=""
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,"”","")
Dim i,ConstrTemp
For i=1 To Len(Constr)
ConstrTemp=ConstrTemp & "<a href='http://www.baidu.com/s?tn=hubeauty&ct=&lm=&z=&rn=&word="& Mid(Constr,i,Num) &"' target='_blank'><b>"& Mid(Constr,i,Num) & "</b></a> | "
Next
CreateBaiduKeyWord=ConstrTemp
End Function
'函数名:CreateBaiduKeyWord
'作 用:由给定的字符串生成包含百度搜索的关键字链接
'参 数:Constr---要生成关键字的原字符串
'返回值:生成的关键字的链接
'**************************************************
Function CreateBaiduKeyWord(byval Constr,Num)
If Constr="" or IsNull(Constr)=True or Constr="" Then
CreateBaiduKeyWord=""
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,"”","")
Dim i,ConstrTemp
For i=1 To Len(Constr)
ConstrTemp=ConstrTemp & "<a href='http://www.baidu.com/s?tn=hubeauty&ct=&lm=&z=&rn=&word="& Mid(Constr,i,Num) &"' target='_blank'><b>"& Mid(Constr,i,Num) & "</b></a> | "
Next
CreateBaiduKeyWord=ConstrTemp
End Function
Author:Administrators UpDateTime:2006-5-25 21:15:49 Click: 404
导航:




网站建设