显示文本格式方法代码.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
  有时大家使用数据库的时候发现插入数据库的一大长篇文章不照你原来的分行。全部挤在一起。那怎么办?   SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT   function DoWhiteSpace(str)   DoWhiteSpace = Replace((Replace(str, vbCrlf,   )), chr(32)chr(32), )   End Function   /SCRIPT   上面这一段的代码的意思是把那些空格和回车转换成ASCII码来显示。   上面一段代码随便插哪里都行。   接下来的就是要改下面的代码。在原来的显示代码里加上DoWhiteSpace既可   原来的代码%=(Recordset1.Fields.Item(msg)。value)%   插入后的代码%= DoWhiteSpace(Recordset1.Fields.Item(msg)。value)%   显示特殊字符代码。   这一段代码相当重要。有时候做一个留言本的话。如果不使用这段代码的话。那就让人有机可乘了。如果人家输入一段恶意的代码的话,你打开就会执行造成死循环   %=server.HTMLEncode(scutia.Fields.Item(cont)。value)%   其实就是要server.HTMLEncode这个   自定义文本长度。   有时做留言本。界面设置好了。怕人家的标题太长的话把表撑开怎么办?   有时直接设置只显示多少个字符就行了。但是这样的话,那长的标题就会被切短,人家不知道后面还有内容,很容易造成误会的。   所以我们就想到了在后面加上个……   %   Function StrLenB( strString )   dim intLoop,intReturn   if isNull(strString) then   StrLenB = 0   exit Function   end if   intReturn = len(strString)   for intLoop = 1 to len(strString)   if ( asc( mid( strString, intLoop, 1 ) ) 0 ) then intReturn = intReturn + 1   next   StrLenB = intReturn   End Function   Function strLeftB( strString ,intLen)   dim intLenB,intLoop   if StrLenB(strString) intLen then   strLeftB = strString   exit Function   end if   for intLoop = 1 to Len(strString)   if ( asc( mid( strString, intLoop, 1 ) ) 0 ) then   intLenB = intLenB + 2   else   intLenB = intLenB + 1   end if   if intLenB intLen then   intLoop = intLoop - 1   exit for   elseif intLenB = intLen then   exit for   end if   next   strLeftB = left(strString,intLoop)   End Function   Function IsLetter( chr )   dim blnReturn   blnReturn = false   if ( ( chr = asc(a) and chr = asc(z) ) or ( chr = asc(A) and chr = asc(Z) ) or ( chr = asc(0) and chr = asc(9) ) ) then   blnReturn = true   end if   IsLetter = blnReturn   End Function   Function AlignString( string, byVal size )   dim r,nLen,n,i,a,s_i   r = string   nLen = StrLenB( string )    if strings width less then size ,return this string .   if ( nLen size ) then   size = size - 2   n = 0   i = 1    cut to index   do whi

文档评论(0)

xcs88858 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档