| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 696 人关注过本帖
标题:限制特殊字符问题???
只看楼主 加入收藏
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
结帖率:76.71%
收藏
 问题点数:0 回复次数:4 
限制特殊字符问题???

Function ReplaceBadWord(g_word)
g_word=Replace(g_word," ","")
g_word=Replace(g_word,",","")
g_word=Replace(g_word,"<","")
g_word=Replace(g_word,".","")
g_word=Replace(g_word,">","")
g_word=Replace(g_word,"/","")
g_word=Replace(g_word,"?","")
g_word=Replace(g_word,";","")
g_word=Replace(g_word,":","")
g_word=Replace(g_word,"'","")
'g_word=Replace(g_word," " ","")
g_word=Replace(g_word,"[","")
g_word=Replace(g_word,"]","")
g_word=Replace(g_word,"{","")
g_word=Replace(g_word,"}","")
g_word=Replace(g_word,"\","")
g_word=Replace(g_word,"|","")
g_word=Replace(g_word,"=","")
g_word=Replace(g_word,"+","")
g_word=Replace(g_word,"-","")
g_word=Replace(g_word,"_","")
g_word=Replace(g_word,")","")
g_word=Replace(g_word,"(","")
g_word=Replace(g_word,"*","")
g_word=Replace(g_word,"^","")
g_word=Replace(g_word,"%","")
g_word=Replace(g_word,"$","")
g_word=Replace(g_word,"@","")
g_word=Replace(g_word,"!","")
g_word=Replace(g_word,"`","")
g_word=Replace(g_word,"~","")

g_word=Replace(g_word,",","")
g_word=Replace(g_word,"《","")
g_word=Replace(g_word,"。","")
g_word=Replace(g_word,"》","")
g_word=Replace(g_word,"、","")
g_word=Replace(g_word,"?","")
g_word=Replace(g_word,";","")
g_word=Replace(g_word,":","")
g_word=Replace(g_word,"‘","")
g_word=Replace(g_word,"“","")
g_word=Replace(g_word,"〔","")
g_word=Replace(g_word,"〕","")
g_word=Replace(g_word,"{","")
g_word=Replace(g_word,"}","")
g_word=Replace(g_word,"、","")
g_word=Replace(g_word,"|","")
g_word=Replace(g_word,"=","")
g_word=Replace(g_word,"+","")
g_word=Replace(g_word,"-","")
g_word=Replace(g_word,"——","")
g_word=Replace(g_word,")","")
g_word=Replace(g_word,"(","")
g_word=Replace(g_word,"×","")
g_word=Replace(g_word,"……","")
g_word=Replace(g_word,"%","")
g_word=Replace(g_word,"¥","")
g_word=Replace(g_word,"@","")
g_word=Replace(g_word,"!","")
g_word=Replace(g_word,"·","")
g_word=Replace(g_word,"~","")


g_word=Trim(Replace(g_word,")",""))
ReplaceBadWord=g_word
End Function

红色的为什么不行,, " 这个字符有什么可以限制输入呢???

搜索更多相关主题的帖子: 字符 Replace word 
2007-01-17 16:47
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
g_word=Replace(g_word,"""","")
将一个双引号替换为空

其实我很低调,只是你不知道...
2007-01-17 16:57
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:0 
我试了下,行。。。但是为什么这样就行了?

ASP讨论QQ群:251346273
2007-01-17 17:04
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
"" 代表一个 " 呀

2007-01-17 17:06
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
两边的引号是必须写的
中间的2个是用来输出一个引号的
如我们经常会写到这样的语句
<%
Response.Write("<Table bgcolor=""#000000"">")
%>
上边语句的意思就是这样
<Table bgcolor="#000000">

[此贴子已经被作者于2007-2-23 9:52:39编辑过]


其实我很低调,只是你不知道...
2007-01-17 17:13
快速回复:限制特殊字符问题???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.112545 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved